Page 294 - Nodejs 교과서 개정2판
P. 294
ౠ ஸۢ݅ ઑഥೡ ࣻب णפ ઑഥܳ ਗೞח ஸۢਸ SELECT ী ֍ਵݶ ؾפ ܴҗ Ѿഒ ৈࠗ݅ ઑ
ഥೞҊ रݶ җ э פ
콘솔
mysql> SELECT name, married FROM nodejs.users;
+------+---------+
| name | married |
+------+---------+
| zero | 0 |
| nero | 1 |
+------+---------+
2 rows in set (0.00 sec)
WHERE ਸ ࢎਊೞݶ ౠ ઑѤਸ о ؘఠ݅ ઑഥೡ ࣻب णפ Ѿഒਸ ೮Ҋ աо ࣁ ࢚ੋ
ࢎਊܳ ઑഥೞח 42-ޙੑפ AND۽ ৈ۞ ઑѤਸ ޘয ࣻب णפ
콘솔
mysql> SELECT name, age FROM nodejs.users WHERE married = 1 AND age > 30;
+------+-----+
| name | age |
+------+-----+
| nero | 32 |
+------+-----+
1 row in set (0.00 sec)
ANDо ઑѤٜਸ ݽف ݅ೞח ؘఠܳ חݶ ORח ઑѤٜ যו ೞաۄب ݅ೞח ؘఠܳ णפ
콘솔
mysql> SELECT id, name FROM nodejs.users WHERE married = 0 OR age > 30;
+----+------+
| id | name |
+----+------+
| 1 | zero |
| 2 | nero |
+----+------+
2 rows in set (0.01 sec)
ORDER BY [컬럼명] [ASC|DESC] ఃਕ٘ܳ ࢎਊೞݶ ۳ب оמפ աо ݆ ࣽࢲ۽ ۳೧ࠁѷणפ
DESCח ղܿରࣽ ASCח য়ܴରࣽ۽ %&4$ܳ ࢎਊೞݶ ؾפ
콘솔