Page 1 of 1

ORDER BY DESC not working

Posted: Thu Mar 22, 2001 11:59 am
by chand012
I need to use an SQL statement of the form:

"select firstname, middlename, lastname from tbl where lastname like 'carter' order by lastname, firstname, middlename DESC"

I have normal indexes on the three name fields and a metamorph index on lastname. This command, however, does not produce the expected results, either at the command line or with WebScript. I tried creating metamorph indexes on the other name fields (just for the hell of it) but that didn't help.

What could be going wrong here?

Thanks,
David

ORDER BY DESC not working

Posted: Thu Mar 22, 2001 12:44 pm
by mark
You probably want
order by lastname desc, firstname desc, middlename desc

ORDER BY DESC not working

Posted: Thu Mar 22, 2001 1:42 pm
by chand012
Thanks. It would be helpful if the documentation reflected this requirement. An example on page http://www.thunderstone.com/site/texisman/node55.html specifically indicates otherwise.

--David

ORDER BY DESC not working

Posted: Thu Mar 22, 2001 1:59 pm
by mark
The documentation and example on that page are correct. And states that the default ordering is ascending. It just doesn't give an example of using descending on more that one field.

ORDER BY DESC not working

Posted: Thu Mar 22, 2001 2:04 pm
by chand012
OK, I get it. --David