View Single Post
  #5 (permalink)  
Old December 1st, 2005, 08:06 AM
rtr1900 rtr1900 is offline
Authorized User
 
Join Date: Nov 2005
Location: , , Spain.
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Hi Chris,

I will try to explain in details what I have and what I want to acomplish:

I have a table where we have orders, but any order can exists of many sublines(products).
What I want to create is a table which contains the suborders, BUT when one of the fields (place) is duplicated it should only show ONCE that record. This because we have the products in differents places. So for example:

Ordernumber Cliente product place
12345 100 222 333
12345 100 222 333
12345 100 222 444
123456 100 222 555

should become:

Ordernumber Cliente product place
12345 100 222 333
12345 100 222 444
123456 100 222 555

I tried many things, like INSERT INTO newtable SELECT DISTINCT ordernumber,place FROM OLDTABLE WHERE [condicion]

But I didnīt succeed in reducing the lines.

Any ideas???

Thx already,

David


Reply With Quote