1.select * from table where (ID = 10) or (ID = 32) or (ID = 22) or (ID = 76) or (ID = 13) or (ID = 44)
让结果按10,32,22,76,13,44的顺序检索出来,请问如何书写? (sql能力)
select * from table where (ID = 10) or (ID = 32) or (ID = 22) or (ID = 76) or (ID = 13) or (ID = 44) order by field(ID,10,32,22,76,13,44)
2.
有如下表和数组
把num值处于[20,29]之间,改为20
num值处于[30,39]之间的,改为30
mian表
+------+
| num |
+------+
| 3 |
| 12 |
| 15 |
| 25 |
| 23 |
| 29 |
| 34 |
| 37 |
| 32 |
| 45 |
| 48 |
| 52 |
+------+
Update num set num=floor(num/10)*10 where num>=20 and num<40;