php - SQL - Double and statement -
this question has answer here:
- sql statement ignoring parameter 1 answer
i trying select data 2 tables, conditions has true. trying join and/or statements together.
select a.token, a.fixed_expire, b.token, b.username, count(distinct a.token) adcount, count(distinct b.username) clickcount advertisements join advertisement_clicks b on b.token=a.token a.status='2' , (a.clicks_left > 0 or a.daily ='1' or a.fixed='1' and(a.fixed_expire>'2')) so, above query doesn't work. question is, how can join or a.fixed='1' and(a.fixed_expire>'2') inside original and operation?
if a.fixed='1' should check a.fixed_expire>2
(a.clicks_left > 0 or a.daily ='1' or a.fixed='1' )and(a.fixed_expire>'2')
you should group or statements
Comments
Post a Comment