Select statement to check multiple rows against 2 variables

Posted by Duncan Cook on Stack Overflow See other posts from Stack Overflow or by Duncan Cook
Published on 2012-11-06T10:55:52Z Indexed on 2012/11/06 11:00 UTC
Read the original article Hit count: 180

Filed under:
|
|

I have the following table :

alertID inspectorID datelive                dateread
1           none    2012-11-06 10:36:03.350 NULL
2           none    2012-11-06 10:36:25.043 NULL
3           none    2012-11-06 10:36:42.433 NULL
1           31030   2012-11-06 10:37:19.193 2012-06-11 10:34:47.000

I want to select the alerts that dont have the inspectors ID against it AND where the alert ID doenst match the one that has the inspectorID against it, ie inspector has read alert 1 so i only want it to return alerts 2 & 3

Am using Classic ASP and MS-SQL

Cheers

© Stack Overflow or respective owner

Related posts about sql

Related posts about select