Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Creating Combined Queries

$
0
0
Hello Help forum,[code]SELECT vend_id, prod_id, prod_priceFROM productsWHERE prod_price <=5UNIONSELECT vend_id, prod_id, prod_priceFROM productsWHERE vend_id IN (1001, 1002);[/code][code]SELECT vend_id, prod_id, pro_priceFROM productsWHERE prod_price <=5OR vend_id IN (1001, 1002);[/code]My question, I am trying to create the same logic from the UNION using the 2 WHERE statements would I use the OR or AND operator?

Viewing all articles
Browse latest Browse all 3145

Trending Articles