sql server - How do you select an exact date in SQL? -


select o.customerid, c.customername, o.orderdate orders o, customers c o.orderdate='1997-08-26'; 

using sample northwind db, can't quite figure out wrong? have used format of date used in sample table.

i trying extract id , name of placed order on 26th.

you need join orders , customers tables each other:

select o.customerid, c.customername, o.orderdate orders o, customers c o.orderdate='19970826' , o.customerid = c.customerid 

using explicit syntax:

select o.customerid,         c.customername,         o.orderdate    orders o         join customers c           on c.customerid = o.customerid   o.orderdate = '19970826'  

you should read explicit vs. implicit join syntax.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -