macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: Comparing two queries yields one result too many

Subject: Re: Comparing two queries yields one result too many
From: CodeJockey
Date: Thu, 23 Aug 2007 12:06:10 -0000
Newsgroups: macromedia.coldfusion.cfml_general_discussion

On Aug 23, 3:04 am, "Stressed_Simon" <webforumsu...@xxxxxxxxxxxxxx>
wrote:
> Why are you making this so complicated? [b]cf_dev2[/b]'s example using the 
> left
> join is entirely correct! Also MSSQL does allow you do do query of queries, 
> use
> temporary tables. Do not loop though queries and do query or queries it is
> overkill when you can easily solve the solution on your db where you are
> supposed to, it is just lazy.

You could also use a union if both queries return the same number and
types of columns.

for example, the following query will only the employees that aren't
located in Michigan:

select firstname, lastname, salary
from employees
where location = michigan

union

select firstname, lastname, salary
from employees


<Prev in Thread] Current Thread [Next in Thread>