Results 1 to 4 of 4

Thread: tell me the query using joins and count!

  1. #1
    Junior Member
    Join Date
    Aug 2007
    Answers
    2

    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:


  2. #2
    Junior Member
    Join Date
    Feb 2007
    Answers
    26

    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


  3. #3
    Junior Member
    Join Date
    Aug 2007
    Answers
    2

    Re: tell me the query using joins and count!

    thanks for clarifying me


  4. #4
    Junior Member
    Join Date
    Aug 2007
    Answers
    2

    Smile 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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact