Excellent. Sometimes you might need to filter using an additional where clauses such as MyColumn=Foo in which case the query should be altered to:
SELECT A.userID + 1 FROM MyTable AS A WHERE MyCLause AND NOT EXISTS ( SELECT B.userID FROM MyTable AS B WHERE MyClause AND A.userID + 1 = B.userID) GROUP BY A.userID;
2 comments:
Excellent. Sometimes you might need to filter using an additional where clauses such as MyColumn=Foo in which case the query should be altered to:
SELECT A.userID + 1
FROM MyTable AS A
WHERE MyCLause AND NOT EXISTS (
SELECT B.userID FROM MyTable AS B
WHERE MyClause AND A.userID + 1 = B.userID)
GROUP BY A.userID;
Thank you! Exactly what I was looking for.
Post a Comment