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.
| Author |
Topic |
|
hariharanpalani
Starting Member
2 Posts |
Posted - 2006-05-09 : 06:38:56
|
| HiIn my procedure, right now i am using left outer join to retrieve the rows according to the conditions. Whether any alternate way like sub queries can be written to retrieve the rows.For ref, i have given the query also. Among joined tables(i.e,dbo.RTS_TBLALERTTITLES,dbo.RTS_tblAlertUsers) , any one of the table will have records respect to the parent table(dbo.RTS_INCIDENTALERTS)/********************************************************************************************************/SELECT dbo.RTS_INCIDENTALERTS.AlertID, dbo.RTS_INCIDENTALERTS.Name, dbo.RTS_INCIDENTALERTS.IncidentEntityID, dbo.RTS_INCIDENTALERTS.OrganizationEntityID, dbo.RTS_INCIDENTALERTS.NumberOfDays, dbo.RTS_INCIDENTALERTS.SeverityID, dbo.RTS_INCIDENTALERTS.StatusID, dbo.RTS_tblAlertUsers.RoleID AS ALERTROLES, dbo.RTS_TBLALERTTITLES.TitleIDFROM dbo.RTS_INCIDENTALERTS LEFT OUTER JOIN dbo.RTS_tblAlertUsers ON dbo.RTS_INCIDENTALERTS.AlertID = dbo.RTS_tblAlertUsers.AlertID LEFT OUTER JOIN dbo.RTS_TBLALERTTITLES ON dbo.RTS_INCIDENTALERTS.AlertID = dbo.RTS_TBLALERTTITLES.AlertID hariharanpalani |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2006-05-09 : 06:53:28
|
| why do you want to use Sub Query?? Are you not getting expected output??If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them. |
 |
|
|
druer
Constraint Violating Yak Guru
314 Posts |
Posted - 2006-05-09 : 12:50:12
|
| Performance is much better using the JOIN ON condition instead of sub select so I'd stick with it.Hope it helps,DaltonBlessings aren't so much a matter of "if they come" but "are you noticing them." |
 |
|
|
|
|
|
|
|