select 查询模型
1代表真的 查询所有
mysql> select *from user where 1;
±----±-----±----+
| uid | name | age |
±----±-----±----+
| 1 | aaa | 26 |
| 2 | gjp | 25 |
| 3 | dg | 27 |
0 代表假 表示不查询
mysql> select *from user where 0;
Empty set (0.00 sec)
列是变量可以参与运算(广义投影)
mysql> select goods_id,goods_name,market_price,shop_price,market_price-shop_price from goods;
±---------±-----------------------------±-------------±-----------±------------------------+
| goods_id | goods_name | market_price | shop_price | market_price-shop_price |
±---------±-----------------------------±-------------±-----------±------------------------+
| 1 | kd876 | 1665.60 | 1388.00 | 277.60 |
| 4 | 诺基亚n85原装充电器 | 69.60 | 58.00 | 11.60 |
| 3 | 诺基亚原装5800耳机 | 81.60 | 68.00 | 13.60 |
| 5 | 索爱原装m2卡读卡器 | 24.00 | 20.00 | 4.00 |
| 6 | 胜创kingmax内存卡 | 50.40 | 42.00 | 8.40 |