-
Junior Member
tell me the query using joins and count!
Can any one please tell me the query for the given scenario:
I have a very bad knowledge with SQL queries,so kindly help me:
I have two tables "Advertisement" and "responses".
Advertisement table fields are: AdID(unique),title,username
responses table fields are:AdID(which is the same value in Advertisement table),responses.(it may have any number odf responses for the same Ad id)
Now i need a single query in which i should get the Adid,Title and the count of number of responses to the Adid:
-
Junior Member
Re: tell me the query using joins and count!
hello ramesh ,
try if the fllowing can help ur problem.
select adid a,adid r, count(r.responses),title a from advertisement
a,responses r where a.adid=r.adid group by a.adid.
if u get the right answer do let me know will explian you the whole scene.
reet dhiman
-
Junior Member
Re: tell me the query using joins and count!
-
Junior Member
Re: tell me the query using joins and count!
Hai reet_dhiman,
Its working fine.Thanks for ur quick response.Thanks a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules