Urgent : SQL Query Question

Results 1 to 2 of 2

Thread: Urgent : SQL Query Question

  1. #1
    Join Date
    Dec 1969

    Default Urgent : SQL Query Question

    Hellow all,<BR>I am stuck here while making www.offersforyou.com<BR>(Check it out !)<BR>DataBase : MS-Access 97<BR>On the home page, I want to list out all main categories from Categories table.My classified offers lie in Classified table.<BR>I have to list out all categories even if there are no offers for it.I mean if some category has no offer,in bracket it should show (0).<BR><BR>To achieve the count for all categoies, I create a query which has a relationship Cat_Code common in both the tables.Then I am counting the number of each category.So I know the total no of offers in that.<BR><BR>But this doesnt include those categories which are not there in classified table.So categories having no offers are not coming into picture.<BR><BR>Can anybody tell me how to get the count of all categories from <BR>Classified table..??<BR><BR>Please,<BR>Rushi@emqube.com<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Urgent : SQL Query Question

    Make sure you do a Left Join to Classifieds, so even when the right hand table Categories has no records, the Left hand table still returns records.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts