Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 help with a query

Author  Topic 

tpiazza55
Posting Yak Master

162 Posts

Posted - 2007-09-21 : 12:33:51
i need to have the results of select in another part of the same query

query 1 -- select foldername, folderdate, filename from folders

query2 -- select auditname from audits where foldername = foldername from 1

how do i combine these two into one query?

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2007-09-21 : 12:37:06
Simply join Folder table with Audits table on foldername column.

Select f.FolderName, f.FolderDate, f.FileName, a.AuditName
From Folders f join Audits a
on f.FolderName = a.FolderName


Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -