I’m not a sql guru at all but why does this query return error?
SELECT username FROM history as h
WHERE username IS NOT NULL AND updated>1342555201 AND updated<1342641599
AND WHERE (SELECT status FROM managers WHERE username=h.username) > 0
How to group out usernames with status>0 in one query using the subquery on second table containing statuses?
try
Note :
INNER JOINwill always retrive NOT NULL and common value of usernamei assume that both table have same column name.if both table have different column name then change
USING(username)withON h.column_name = s.column_name