によって順序が私のようなテーブルを持っている:SQL文の
table A
id name email
1 test1 [email protected]
2 test2 [email protected]
3 test3 [email protected]
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.
私は私ができることを知っています最初の2人のユーザーを取得するための特定のSQLを持っており、ちょうど が残ります。しかし、私はステートメントで良いORDERでそれらをすべて得ることができないはずですか? 1行目のステートメントを1行目に限定するのと同じように...
質問に対する回答がある場合は、同意してください。 –