SQL-Where Condition


Select coulmn_name(1)coulmn_name(2)coulmn_name(3)coulmn_name(4) 
FROM 
table_name

where coulmn_name in ('Condition1','Condition2') and coulmn_name in ('Condition3'

1. Example

select listing_Id, buyer_org_id, buyer_org_name, seller_city_repo FROM category.food_fmcg_sales

where seller_city_repo in ('Delhi','Faridabad') and sub_category_repo in ('FMCG')

Output




2. Example

Select listing_id, listing_title, order_id, buyer_org_id, buyer_org_name, buyer_city_repo, buyer_phone, product_id, shipped_gmv, delivered_gmv, buyer_cancel_gmv, vertical, sub_category_repo, order_date_time from category.food_fmcg_sales

where buyer_city_repo in ('Delhi','Faridabad','Gurgaon') and vertical in ('Soap', 'Biscuit','Toothpaste','Noodle','facewash') and sub_category_repo in ('FMCG') and order_month in ('2021/05')

Output


No comments:

Post a Comment