snowboardr
Programmer
I am having trouble with a SQL statement
This code works right it returns all records in userwindow as null except one which has uw.waction=2 this is right... but as you see on the second code i have tried everything to not show records that have uw.waction=2
I have tried to do coalesce on uw.waction and then show all 0 values in waction, that didnt work... i have tried != and <> and its not returning anything back...
Any ideas?
Regards,
Jason
Jason
[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]
This code works right it returns all records in userwindow as null except one which has uw.waction=2 this is right... but as you see on the second code i have tried everything to not show records that have uw.waction=2
Code:
Select th.tid, th.tname, th.tmain, th.tcolor,coalesce(c.postnumber,0) as posts, uw.wuid, uw.wwid, uw.waction FROM thread AS th left JOIN ( SELECT ptid, sum(ptype=0) as postnumber FROM forumpost GROUP by ptid) as c on c.ptid = th.tid LEFT JOIN userwindow uw ON uw.wwid=th.tid AND uw.wuid=2 WHERE th.tmain=1
Code:
Select th.tid, th.tname, th.tmain, th.tcolor,coalesce(c.postnumber,0) as posts, uw.wuid, uw.wwid, uw.waction FROM thread AS th left JOIN ( SELECT ptid, sum(ptype=0) as postnumber FROM forumpost GROUP by ptid) as c on c.ptid = th.tid LEFT JOIN userwindow uw ON uw.wwid=th.tid AND uw.wuid=2 WHERE th.tmain=1 AND uw.waction<>2
I have tried to do coalesce on uw.waction and then show all 0 values in waction, that didnt work... i have tried != and <> and its not returning anything back...
Any ideas?
Regards,
Jason
Jason
[red]Army[/red] : [white]Combat Engineer[/white] : [blue]21B[/blue]