Select goods_id, cat_id, goods_name, shop_price from ecs_goods
Where shop_price> 3000;
1.4: the store price is less than or equal to 100 yuan of goods
Select goods_id, cat_id, goods_name, shop_price from ecs_goods where shop_price <= 100;
1.5: take out the products of column 4th or column 11th (not allowed or)
Select goods_id, cat_id, goods_name, shop_price from ecs_goods
Where cat_id in (4, 11 );
1.6: 100 <= Price <= 500 (and not allowed)
Select goods_id, cat_id, goods_name, shop_price from ecs_goods
Where shopp_price between 100 and 500;
1.7: Retrieve products that do not belong to column 3rd and do not belong to column 11th (and, or not in, respectively)
Select goods_id, cat_id, goods_name, shop_price from ecs_goods where cat_id! = 3 and cat_id! = 11;
Select goods_id, cat_id, goods_name, shop_price from ecs_goods where cat_id not in (3,11 );
1.8: goods whose prices are greater than 100 and less than 300, or greater than 4000 and less than 5000 ()
Select goods_id, cat_id, goods_name, shop_price from ecs_goods where shop_price> 100 and shop_price <300 or shop_price> 4000 and shop_price <5000;
1.9: take out the price <3rd or> 1000 under the 3000 columns, and click more than 5 series of products
Select goods_id, cat_id, goods_name, shop_price, click_count from ecs_goods where
Cat_id = 3 and (shop_price <1000 or shop_price> 3000) and click_count> 5;
1.10: take out the items under the 1st columns (note: 1 there are no items under the column, but there are items under its subcolumns)
Select goods_id, cat_id, goods_name, shop_price, click_count from ecs_goods
Where cat_id in (2, 3, 4, 5 );
1.11: products whose names start with "Nokia"
Select goods_id, cat_id, goods_name, shop_price from ecs_goods where goods_name like 'Nokia % ';
1.12: retrieve the phone number named "Nokia Nxx"
Select goods_id, cat_id, goods_name, shop_price from ecs_goods
Where goods_name like 'Nokia N __';
1.13: products whose names do not start with "Nokia"
Select goods_id, cat_id, goods_name, shop_price from ecs_goos
Where goods_name not like 'Nokia % ';
1.14: take out the prices of the 3rd topics between 1000 and 3000, and click products starting with 5 "Nokia ".
Select goods_id, cat_id, goods_name, shop_price from ecs_goods where
Cat_id = 3 and shop_price> 1000 and shop_price <3000 and click_count> 5 and goods_name like 'Nokia % ';
Select goods_id, cat_id, goods_name, shop_price from ecs_goods where
Shop_price between 1000 and 3000 and cat_id = 3 and click_count> 5 and goods_name like 'Nokia % ';
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.