I have doubt on my SQL.
Please find the query
select a.id, a.phone, b.list,c.ctitle,l,
if(last_id!=0 and date(activity)=date(start_date),
CONCAT(ag.firstname,' ‘,ag.lastname) ,’')
from table name a
left join <all other tables>
where a.cid = '100' and a.date between '2013-05-01' and '2015-06-14';
The output is showing properly.currently i am getting firstname and lastname. But for some entries first name and last name empty. I need to modify the query so that i can print the non-null value of the column if(last_id!=0 and date(activity)=date(start_date), CONCAT(ag.firstname,' ‘,ag.lastname) ,’') ie same query excluding the null entries for firstname and last name. I tried IS NOT NULL but not working.
Please help