Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a view with no duplicate lines ?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
HI!
I have just created a view containing informations from two tables :
CUSTOMER and ADDRESS.

The problem is the following :
In the view, I can see many lines corresponding to the same customer because some customers have many addresses.

I only want one line for each customer in my view because in my software (wich use oracle as database) the user can select the customers in a summary : it is unuseful to see in that summary the same customer many times!
What can I do :
1/to create my view
2/to show each customer only one time in my summary?
Is it possible to use the 'distinct' clause in any way ?

Thank you for your help.

Nicodem








 
Yes, you can use DISTINCT. However, if you are doing something like populating a pick list, you would be better off just pulling information from the CUSTOMERS table; pulling from the view forces a join of two tables to present information from only one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top