find differences between two mysql_query results HELP

find differences between two mysql_query results HELP

am 29.05.2006 10:11:48 von Madd_Matt

When I type an agentnum and hit submit at will look up that agentnum
and tell you what skill set (msp_sk,ste_sk,wash_sk,ectect) they are not
a part of.

For Example
the first statement I have been ussing is this. it Tells me what they
DO have.
SELECT queue FROM agentqueue_table WHERE agentnum='12345' GROUP BY
queue;
The result is
+-----------+
| queue |
+-----------+
| msp_sk |
| ste_sk |
+------------+

The second statment is, it tells me what all the skill sets are.
SELECT queue FROM agentqueue_table GROUP BY queue;
+-------------+
| queue |
+-------------+
| msp_sk |
| ste_sk |
| wash_sk |
+-------------+

I want to compare the two results and know the difference is wash_sk

I need to do this dynamicly as well. Lets say I do another agentnum
lookup with agent 54321 and his results are as followed
+-----------+
| queue |
+-----------+
| msp_sk |
| wash_sk |
+------------+
and compare it to again,
SELECT queue FROM agentqueue_table GROUP BY queue;
+-------------+
| queue |
+-------------+
| msp_sk |
| ste_sk |
| wash_sk |
+-------------+
The answer I want to get then is ste_sk

If I am going about this all wrong please let me know!
I have spent all day trying to find a way to do this and i can't! I am
going nuts... Please help!

Re: find differences between two mysql_query results HELP

am 29.05.2006 13:39:24 von zac.carey

What version? Assuming you can use subqueries then you should be able
to do something like;

select statement b where not in (select statement a)