Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting Problem

Status
Not open for further replies.

warik

Programmer
Jun 28, 2002
169
ID
Dear all,

What SELECT is the best for this sorting problem?

table mytable:

No | Name | ID
1 | aaa | 20
2 | bbb | 90
3 | ccc | 80
4 | ddd | 10



I would like to sort become like this :
Sort from name, but ID 90 will be the last. So it will be like this:

No | Name | ID
1 | aaa | 20
3 | ccc | 80
4 | ddd | 10
2 | bbb | 90


What I know to sort name with:
select * from mytable order by name.....
what next? or any other advice?

Thank you in advance.
 
warik:
Dude, pick one forum for your posts. Cross-posting, contrary to popular belief, does not get you better answers or answers more quickly.

All:
As this question is more apropos to the MySQL forum than the PHP forum, I am cross-posting my initial answer there.

Please direct your answers to thread436-665780


Want the best answers? Ask the best questions: TANSTAAFL!!
 
Thank you sleipnir214 for your answer. I thought this problem also can be solved with php script except MySQL itselft. Anyway... thank's a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top