kanoute 发表于 2007-11-6 08:49
[求助]SQL排序问题
我的 SQL语句是这样的:<BR>select * from 表<BR>where <BR>id=5 or<BR>id=105 or<BR>id=201 or<BR>id=43 ;<BR><BR>我并没加order by,但出来的结果是:他按id的先后顺序排列了,而我需要的是他按我查询的顺序排,即<BR>5,105,201,43这样,而非5,43,105,201。有人知道怎样解决吗?<BR>
缘吇弹 发表于 2007-11-8 17:34
试下:<BR>select * from 表 where id=5<BR>union<BR>select * from 表 where id=105<BR>union<BR>select * from 表 where id=201<BR>union <BR>select * from 表 where id=43<BR> <BR>
kanoute 发表于 2007-11-8 18:06
这个我也试过了,我也以为行,但是。。。
页:
[1]