Prepare for your Next Interview
This is a discussion on tell me the query using joins and count! within the SQL forums, part of the Databases category; 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" ...
|
|||
|
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: |
| Sponsored Links |
|
|||
|
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 |
| The Following User Says Thank You to reet_dhiman For This Useful Post: | ||
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How the joins work in SQL | savitha_shankar | Database General | 11 | 07-15-2008 11:06 AM |
| Open defect count | prasu | Testing Templates | 2 | 10-24-2007 08:46 AM |
| I want to tune four tables and 5 joins condition | Caleb Sima and Vincent Li | Oracle | 2 | 06-29-2007 09:19 AM |
| What is the Difference between Count & Count all function in Business Objects | nikitababaria | Data Warehousing | 2 | 05-30-2007 01:08 PM |
| Can you Count | sripri | Brainteasers | 1 | 08-17-2006 05:25 AM |