Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3585

Re: Datawindow with SQL SubSelect? PB 12.5

$
0
0

you probably can use a correlated subquery to do the ranking in your select.  

 

something like the following but using your tables and columns etc.

 

 

select yourcolumns,

  (select count(*) from table1 t2

    where t2.spid < table1.spid

       and t2.vehicleid = table1.vehicleid and t2.tripid = table1.tripid

   ) as rank

from table1

where ....


Viewing all articles
Browse latest Browse all 3585

Trending Articles