I have two queries that return the same dataset.
Here is one:
Here is the other:
I put these queries onto and ASP.NET page, and the SELECT DISTINCT seems to run a bit faster.
Could anyone tell me which of these two methods is better, and why? Or, since this has probably been discussed before, point out a link explaining the difference between the two?
Thanks for your help,
CJB
Here is one:
Code:
SELECT DISTINCT pg_content.pg_index, pg_content.pg_id, pg_content.elem_id, pg_content.stat_weight, pg_content.text_string
FROM pg_content, pg_master
WHERE (((pg_content.pg_id)="busLon") AND ((pg_content.end_date)>=#9/25/2004#) AND ((pg_content.start_date)<=#9/25/2004#)) OR (((pg_content.pg_id)=[pg_master].[sect_id]) AND ((pg_content.end_date)>=#9/25/2004#) AND ((pg_content.start_date)<=#9/25/2004#) AND ((pg_master.pg_id)="buslon"));
Here is the other:
Code:
SELECT pg_content.pg_index, pg_content.pg_id, pg_content.elem_id, pg_content.stat_weight, pg_content.text_string
FROM pg_master RIGHT JOIN pg_content ON pg_master.sect_id = pg_content.pg_id
WHERE (((pg_content.pg_id)="busLon") AND ((pg_content.end_date)>=#9/25/2004#) AND ((pg_content.start_date)<=#9/25/2004#)) OR (((pg_content.end_date)>=#9/25/2004#) AND ((pg_content.start_date)<=#9/25/2004#) AND ((pg_master.pg_id)="busLon"));
I put these queries onto and ASP.NET page, and the SELECT DISTINCT seems to run a bit faster.
Could anyone tell me which of these two methods is better, and why? Or, since this has probably been discussed before, point out a link explaining the difference between the two?
Thanks for your help,
CJB