likep used with order by clause

Post Reply
kevin31
Posts: 74
Joined: Fri Nov 01, 2002 12:45 pm

likep used with order by clause

Post by kevin31 »

I wish to write a likep query with results ordered by something other than the rank. However I still need to have the rank returned. Therefore I would be writing a query something like:

select $$rank r, ID where TextValue likep 'foobar' order by ID;

Will this return exactly the same set of results with or without the "order by" clause? Will the "order by" clause affect the rankings?
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

likep used with order by clause

Post by Kai »

It will return the same set of results, with the same ranks, regardless of the ORDER BY. The ORDER BY only affects the order of the results, and is applied after the query in this case.
Post Reply