Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT idCustomer FROM reservations
- WHERE idCustomer NOT IN
- (SELECT distinct idCustomer FROM reservations
- WHERE DATEPART ( hour, insertDate) < 2)
- SELECT idCustomer FROM reservations
- SELECT distinct idCustomer FROM reservations
- WHERE DATEPART ( hour, insertDate) < 2
- SELECT distinct idCustomer FROM reservations
- WHERE DATEPART ( hour, insertDate) < 2
- and idCustomer is not null
- WHERE field1 NOT IN (1, 2, 3, null)
- WHERE NOT (field1 = 1 OR field1 = 2 OR field1 = 3 OR field1 = null)
- IF 1 NOT IN (1, 2, 3, NULL) PRINT '1 NOT IN (1, 2, 3, NULL)'
- IF 1 NOT IN (2, 3, NULL) PRINT '1 NOT IN (2, 3, NULL)'
- IF 1 NOT IN (2, 3) PRINT '1 NOT IN (2, 3)' -- Prints
- IF 1 IN (1, 2, 3, NULL) PRINT '1 IN (1, 2, 3, NULL)' -- Prints
- IF 1 IN (2, 3, NULL) PRINT '1 IN (2, 3, NULL)'
- IF 1 IN (2, 3) PRINT '1 IN (2, 3)'
- SELECT idCustomer FROM reservations
- EXCEPT
- SELECT idCustomer FROM reservations WHERE DATEPART ( hour, insertDate) < 2
- SELECT Reservations.idCustomer FROM Reservations (nolock)
- LEFT OUTER JOIN @reservations ExcludedReservations (nolock) ON Reservations.idCustomer=ExcludedReservations.idCustomer AND DATEPART(hour, ExcludedReservations.insertDate) < 2
- WHERE ExcludedReservations.idCustomer IS NULL AND Reservations.idCustomer IS NOT NULL
- GROUP BY Reservations.idCustomer
Add Comment
Please, Sign In to add comment