Spudhead
12-05-2003, 09:46 AM
Can I rewrite this:
SELECT DISTINCT [Broch Section]
FROM [myProducts]
WHERE [Product Type]='Accommodation'
AND [Product ID] IN (
SELECT SKUNum FROM tblACC_Live
INNER JOIN tblTRV_Live on tblACC_Live.TRVID=tblTRV_Live.TRVID
WHERE tblTRV_Live.DepartDate='23/05/2004'
)
ORDER BY [Broch Section]
as this:
SELECT DISTINCT [Broch Section]
FROM [myProducts]
INNER JOIN tblACC_Live ON myProducts.[Product ID]=tblACC_Live.SKUNum
INNER JOIN tblTRV_Live on tblACC_Live.TRVID=tblTRV_Live.TRVID
WHERE [myProducts].[Product Type]='Accommodation'
AND tblTRV_Live.DepartDate='23/05/2004'
ORDER BY [Broch Section]
And more importantly, what's the difference between the two? Will they get different results? Is one faster? Is one faster in one way but not in another? Is it all a little pointless?:)
SELECT DISTINCT [Broch Section]
FROM [myProducts]
WHERE [Product Type]='Accommodation'
AND [Product ID] IN (
SELECT SKUNum FROM tblACC_Live
INNER JOIN tblTRV_Live on tblACC_Live.TRVID=tblTRV_Live.TRVID
WHERE tblTRV_Live.DepartDate='23/05/2004'
)
ORDER BY [Broch Section]
as this:
SELECT DISTINCT [Broch Section]
FROM [myProducts]
INNER JOIN tblACC_Live ON myProducts.[Product ID]=tblACC_Live.SKUNum
INNER JOIN tblTRV_Live on tblACC_Live.TRVID=tblTRV_Live.TRVID
WHERE [myProducts].[Product Type]='Accommodation'
AND tblTRV_Live.DepartDate='23/05/2004'
ORDER BY [Broch Section]
And more importantly, what's the difference between the two? Will they get different results? Is one faster? Is one faster in one way but not in another? Is it all a little pointless?:)