like 模糊查询 _单一字符
1.查出满足以下条件的商品
mysql> select goods_id,goods_name,shop_price from goods where goods_id=32;
±---------±-----------±-----------+
| goods_id | goods_name | shop_price |
±---------±-----------±-----------+
| 32 | 诺基亚n85 | 3010.00 |
±---------±-----------±-----------+
2:不属第3栏目的所有商品
mysql> select goods_id,goods_name,shop_price from goods where cat_id!=3;
±---------±-----------------------------±-----------+
| goods_id | goods_name | shop_price |
±---------±-----------------------------±-----------+
| 1 | kd876 | 1388.00 |
| 4 | 诺基亚n85原装充电器 | 58.00 |
| 3 | 诺基亚原装5800耳机 | 68.00 |
| 5 | 索爱原装m2卡读卡器 | 20.00 |
| 6 | 胜创kingmax内存卡 | 42.00 |
| 7 | 诺基亚n85原装立体声耳机hs-82 | 100.00 |
| 14 | 诺基亚5800xm | 2625.00 |
| 16 | 恒基伟业g101 | 823.33 |
| 18 | 夏新t5 | 2878.00 |
| 23 | 诺基亚n96 | 3700.00 |
| 25 | 小灵通/固话50元充值卡 | 48.00 |
| 26 | 小灵通/固话20元充值卡 | 19.00 |
| 27 | 联通100元充值卡 | 95.00 |
| 28 | 联通50元充值卡 | 45.00 |
| 29 | 移动100元充值卡 | 90.00 |
| 30 | 移动20元充值卡 | 18.00 |
±---------±-----------------------------±-----------+
3:本店价格高于3000元的商品
mysql> select goods_id,cat_id,goods_name,shop_price from goods where shop_price>3000;
±---------±-------±---------------±-----------+
| goods_id | cat_id | goods_name | shop_price |
±---------±-------±---------------±-----------+
| 22 | 3 | 多普达touch hd | 5999.00 |
| 23 | 5 | 诺基亚n96 | 3700.00 |
| 32 | 3 | 诺基亚n85 | 3010.00 |
±---------±-------±---------------±-----------+
4