find differences between two mysql_query results HELP

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!
Madd_Matt [ Mo, 29 Mai 2006 10:11 ] [ ID #1333735 ]

Re: find differences between two mysql_query results HELP

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)
zac.carey [ Mo, 29 Mai 2006 13:39 ] [ ID #1333736 ]
PHP » alt.php.sql » find differences between two mysql_query results HELP

Vorheriges Thema: retaiing values when resubmitting a page
Nächstes Thema: Ticking a check box based on a value from a record