I've got tables like:
table A
id name email
1 test1 ex@ex.com
2 test2 ex@ex.com
3 test3 ex@ex.com
4 test4 ....
5 test5 ....
table B
id catA catB year member
1 false true 2011 2
2 true false 2011 3
3 fals true 2010 5
我希望获取表A中的每一行,并按以下方式进行排序:
FIRST, get user 2 (current year, based on table B)
SECOND, get user 3 (current year, based on table B)
after that get users that is in table B
after that get all other users.
我知道我可以使用特定的SQL语句来获取前两个用户,然后再获取其余的用户。但是,我认为我应该能够通过美观清晰的ORDER BY语句获取所有用户,就像将第一个ORDER BY语句限制为只影响第一行一样...