Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 OR question

Author  Topic 

neutcomp
Posting Yak Master

111 Posts

Posted - 2004-03-29 : 05:18:07
Hello,

I have the right query but I want to add one more thing but I cant get it to work:


SELECT a.idUser, a.status, c.geboortedatum, c.plaats, g.regio, f.landen, h.geslacht, c.nickname, d.gezicht, d.neus, d.ogen, d.neus, d.mond, d.haren, e.foto1, e.snapshot
FROM tblusers AS a LEFT JOIN tblnaw AS c USING(idUser),
tblusers AS aa LEFT JOIN tblcompositie AS d USING(idUser),
tblusers AS aaa LEFT JOIN tblpresentatie AS e USING(idUser),
tblnaw AS cc LEFT JOIN pulllanden AS f USING(idLand),
tblnaw AS ccc LEFT JOIN pullregio AS g USING(idRegio),
tblnaw AS cccc LEFT JOIN pullgeslacht AS h USING(idGeslacht)
WHERE c.idGeslacht = 2
AND cc.idGeslacht = 2
AND ccc.idGeslacht = 2

AND c.idZoekGeslacht = 1
AND cc.idZoekGeslacht = 1
AND ccc.idZoekGeslacht = 1

AND a.emailbevestiging = 1
AND aa.emailbevestiging = 1
AND aaa.emailbevestiging = 1

GROUP BY idUser


But I want only the people where the e.snapshot OR the e.foto1 is "1".
Hope you can help me out?

Thanxx
Bjorn

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-03-29 : 06:25:26
SELECT a.idUser, a.status, c.geboortedatum, c.plaats, g.regio, f.landen, h.geslacht, c.nickname, d.gezicht, d.neus, d.ogen, d.neus, d.mond, d.haren, e.foto1, e.snapshot
FROM tblusers AS a LEFT JOIN tblnaw AS c USING(idUser),
tblusers AS aa LEFT JOIN tblcompositie AS d USING(idUser),
tblusers AS aaa LEFT JOIN tblpresentatie AS e USING(idUser),
tblnaw AS cc LEFT JOIN pulllanden AS f USING(idLand),
tblnaw AS ccc LEFT JOIN pullregio AS g USING(idRegio),
tblnaw AS cccc LEFT JOIN pullgeslacht AS h USING(idGeslacht)
WHERE (c.idGeslacht = 2
AND cc.idGeslacht = 2
AND ccc.idGeslacht = 2

AND c.idZoekGeslacht = 1
AND cc.idZoekGeslacht = 1
AND ccc.idZoekGeslacht = 1

AND a.emailbevestiging = 1
AND aa.emailbevestiging = 1
AND aaa.emailbevestiging = 1)
AND (e.snapshot = 1 or e.foto1 = 1)

GROUP BY idUser


Go to Top of Page

neutcomp
Posting Yak Master

111 Posts

Posted - 2004-03-29 : 06:50:49
Thanxx

it works, Great

Cya
Bjorn
Go to Top of Page
   

- Advertisement -