[thelist] MySQL - selecting records that are NOT in a date range...

David Dorward david at dorward.me.uk
Tue Nov 20 04:20:13 CST 2007


On 20 Nov 2007, at 10:15, Tris wrote:

> So I need to have my daterange (unix timestamp)
> SELECT `UserId` FROM `activities` WHERE `Timestamp` > '1191196799' AND
> `Timestamp` < '1188604800' GROUP BY `UserId`
>
> But how can I say to MySQL: get me all users who DON'T have entries in
> this range...

Replace:
   FOO > a AND FOO < b
With:
   FOO < a OR FOO > b


-- 
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/





More information about the thelist mailing list