次のようなテーブルがあります。
bok jel str1 str2
1 3 184 185
1 3 215 219
1 3 229 244
1 3 267 273
1 3 331 331
1 3 338 339
str1とstr2で並べ替えます。
次のようなテーブルがあります。
bok jel str1 str2
1 3 184 185
1 3 215 219
1 3 229 244
1 3 267 273
1 3 331 331
1 3 338 339
str1とstr2で並べ替えます。
SELECT *
FROM YourTable
ORDER BY str1,
str2
一般的な慣行は次のとおりです。
SELECT *
FROM TEMP
ORDER BY
STR1
, STR2
もう 1 つの可能性は、順序付けSTR1 + STR2
です。ただし、異なる結果が返されることに注意してください。例えばSQLFiddle で
Set NOCOUNT ON
select bok, jel, st1, st2 from YourTable order by str1, str2