Wednesday, November 19, 2014

SQL Server:Inner Join using 'Where' 'Is Not Null' and sorting conditions




SELECT Table1.weborder, Table2.weborder,Table2.web_promocode,Table2.web_cost,Table2.web_price,Table2.web_quantity,Table1.web_ordertime,Table2.web_unitcost
FROM Table1
INNER JOIN web_details
ON Table1.weborder=Table2.weborder where Table2.web_promocode is not null and Table2.web_ordertime>'11/01/2014' and Table2.web_unitcost>0
ORDER BY Table1.web_ordertime desc;

No comments:

Post a Comment