How to display distinct data?

Results 1 to 2 of 2

Thread: How to display distinct data?

  1. #1
    Join Date
    Dec 1969

    Default How to display distinct data?

    I want to display distinct data which is retrieved from a database. The database consists of several table which I have link it through the use of 'inner join' statement in the SQL queries. The problem arises when the outcome is duplicated data as for the tables they have one to many relationship say one user have many cars but I only want to list out only the user. I can't exclude the table from which that data of the car is being retrived 'coz I want to use certain field on that table. So how can I display the result as what I required to do so?

  2. #2
    Join Date
    Dec 1969

    Default Make up your mind...

    So you are doing something like:<BR> Select owners.Name, cars.Make<BR> FROM owners, cars<BR> WHERE cars.ownerID = owners.ownerID<BR><BR>Yes?<BR><BR>So *what* "distinct" data *can* you display if you get back records like<BR> Bill -- Toyota<BR> Bill -- Chevy<BR> Bill -- Ford<BR> John -- Mazda<BR> John -- Volvo<BR>???<BR><BR>None of those records can be combined, can they?<BR><BR>So HOW do you want the data displayed? <BR><BR>Do you want something like:<BR> Bill<BR> Toyota<BR> Chevy<BR> Ford<BR> John<BR> Mazda<BR> Volvo<BR>???<BR><BR>If so, there is an ASPFAQ that shows how to do that, in the category "Database, General."<BR><BR>If that&#039;s *not* what you want, then explain more.<BR><BR>

Posting Permissions

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