Page 1 of 1

likep used with order by clause

Posted: Mon Feb 03, 2003 7:30 pm
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?

likep used with order by clause

Posted: Tue Feb 04, 2003 11:11 am
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.