查询结果做in条件,再按in顺序排序
sql吧
全部回复
仅看楼主
level 2
BrookLee75527 楼主
查询结果做in条件,再按in顺序排序
2017年10月27日 06点10分 1
level 2
BrookLee75527 楼主
谢谢好心人
2017年10月27日 06点10分 2
level 2
BrookLee75527 楼主
select stName from Student where stId in(select distinct stId from score where teId=1);像这样,希望最后按(select distinct stId from score where teId=1)结果顺序排序
2017年10月27日 06点10分 3
[疑问]直接order by stId 你in的字段不就是按照你里面得出的结果排序了么
2017年11月02日 07点11分
level 8
如果说是名字中带有“in”
的意思 那么应该是select *from stu where name link '%in%' and order by name asc
2017年10月29日 14点10分 4
1