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

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -