Can someone give me a little hand on this query
Hi
I have 2 tables
here's the tables
Users:
userid(int)
username(nvarchar)
calendar:
day(datetime)
userid (int)
exception (bit)
I want a list of users with the total exceptions, the problem is that if I do where exception = 1 the ones who don't have any event in the table calendar won't appear...
How can I do it...
# 1 Re: Can someone give me a little hand on this query
Which DBMS are you using? What do you mean by "total exceptions"? What is the relationship between the two tables (I assume a user may have 0-n associated entries in the calendar table, but is this correct)?
# 2 Re: Can someone give me a little hand on this query
Maybe you just need a LEFT OUTER JOIN, but if you answer the above questions it will be clearer.