By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,278 Members | 1,342 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,278 IT Pros & Developers. It's quick & easy.

need double join query or not??

P: n/a
At the moment i have this query:

SELECT number, COUNT( * ) as count ' .
FROM visit ' .
RIGHT JOIN visitHit ON ( visitHit.visitId = visit.id ) AND ( type
= "link" )
WHERE ( brochureId = 57 )
GROUP BY number
ORDER BY number

I get a list of the numbers of the links a have with the number of
times it's clicked.

Now i don't wanna know this but the URL of the link, that's in another
table (pageElement.link)

Do i need a double join query or not? Can somebody help me out with an
example?

May 2 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On May 2, 11:09 am, dikku...@niemaauwe.nl wrote:
At the moment i have this query:

SELECT number, COUNT( * ) as count ' .
FROM visit ' .
RIGHT JOIN visitHit ON ( visitHit.visitId = visit.id ) AND ( type
= "link" )
WHERE ( brochureId = 57 )
GROUP BY number
ORDER BY number

I get a list of the numbers of the links a have with the number of
times it's clicked.

Now i don't wanna know this but the URL of the link, that's in another
table (pageElement.link)

Do i need a double join query or not? Can somebody help me out with an
example?
Is there a real reason you need join already for your first request?

select v.number, count(v.*) as count
from visit v, visitHit, h
where v.brochureid = 57 and h.visitId = v.id and h.type = 'link'
group by v.number
order by v.number

(remark: h.type could also be v.type depends on your data base)

Depending on your database, you might just another table and some more
where statements?

Good luck
Martin

------------------------------------------------
online accounting on bash bases
Online Einnahmen-Ausgaben-Rechnung
http://www.ea-geier.at
------------------------------------------------
m2m server software gmbh
http://www.m2m.at

May 2 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.