How to use join query to fetch data from more than two table
Hi friends,
Once I need your help,
I have three table in my database.
1> wedding
Field Name
Data Type
wedID
Int (Primary Key)
wedName
Varchar(50)
2> siteSelect
int
siteID
Int
siteStatus
3>webSite
siteName
siteFile
Varchar(MAX)
all data from "webSite" table and only data from "siteSelect" where s.siteStatus do not display "Yes" if wedID not match
I want out put as followed
ws.siteID ws.siteName ws.siteFile s.wedID s.sitestatus
1 Show show.jpeg 6 Yes
2 My View my view.png 5
I try following sql query
select DISTINCT(ws.siteID),s.wedID,ws.siteName,ws.siteFile,s.siteStatus from wedding wd, webSite ws left outer join siteSelect s on ws.siteID=s.siteID where wd.wedID=@wedID
but Output as follwed
2 My View my view.png 5 Yes