If you only need the unique VendorNo, you have to specify exactly this column.
SELECT DISTINCT VENDOR
From ...
If you add other columns DISTINCT will return each DISTINCT row (i.e. over all listed columns)
------------------------------
Birgitta Hauser
Database and Software Engineer
Selfemployed - Modernization-Education-Consulting on IBM i
Kaufering
+49 170 5269964
------------------------------
Original Message:
Sent: Fri May 05, 2023 03:05 PM
From: David Strawn
Subject: include distinct values from file
just realized i had another column in the select statement, so the distinct was returning multiple occurs... Will distinct list unique occurrences for vendor # for each different column in the select (that might be useful)?
------------------------------
David Strawn
Original Message:
Sent: Fri May 05, 2023 02:51 PM
From: David Strawn
Subject: include distinct values from file
I used distinct, but the vendors were still there more than once...
------------------------------
David Strawn
Original Message:
Sent: Fri May 05, 2023 01:30 PM
From: Birgitta Hauser
Subject: include distinct values from file
What about:
Select Distinct Col1, Col2, ... ColN
from yourTable;
------------------------------
Birgitta Hauser
Database and Software Engineer
Selfemployed - Modernization-Education-Consulting on IBM i
Kaufering
+49 170 5269964
Original Message:
Sent: Fri May 05, 2023 12:53 PM
From: David Strawn
Subject: include distinct values from file
i have an invoice file that has the same vendor number multiple times. how do I create a result set with just the distinct/unique values of the vendor #?
------------------------------
David Strawn
------------------------------
#SQL