Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Getting a column out of a query you defined within the SQL expression

$
0
0
Hello All,

I have a query as such:
Code:

SELECT Data.Model, Max(Data.Date) AS MaxOfDate
FROM Data

what I want to do is use all of the Dates in the column "MaxOfDates" in a WHERE clause. I can do this by making the query above real and saving this information in a table but I would rather not have this table and embed it directly into the query I really want.

Something like...
Code:

SELECT Data.Model, Date.Data FROM Data WHERE Date.Date In(*this is where I want the dates*)

Viewing all articles
Browse latest Browse all 13329

Trending Articles