Sql select inner query column

How can I display a column from a inner query?

Select ordered from table orders where exists
(Select date from order history where .... )

I want to display the ordered and date.
hojohappyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
In that case you need a inner join

Select ordered, date
from TableOrders o
Inner join orderHistory h on h.orderId = o.orderID
0
 
Shaun KlineLead Software EngineerCommented:
You would need to include both tables in the from clause:
Select orders.ordered, orderhistory.date
from table orders
inner join orderhistory on orders.<pk column> = orderhistory.<fk column> 

Open in new window

0
All Courses

From novice to tech pro — start learning today.