Hi,
I have a very silly question
If I have three records
vndnumber vendorname
---------- --------------
296333 Kraft Inc.
296333 Kraft Inc
296333 Kraft Inter.
and I need to group by vndnumber and make one record from these three and I was told to take MAX(vendorname), why my result is:
296333 Kraft Inc.
and not:
296333 Kraft Inter.
Both fields are varchar and script I use:
SELECT DISTINCT
vndnumber,
vndnumber=MAX(vendorname)
INTO DBO.P_VENDOR
FROM DBO.T_VENDOR
GROUP BY vndnumber
I have a very silly question
If I have three records
vndnumber vendorname
---------- --------------
296333 Kraft Inc.
296333 Kraft Inc
296333 Kraft Inter.
and I need to group by vndnumber and make one record from these three and I was told to take MAX(vendorname), why my result is:
296333 Kraft Inc.
and not:
296333 Kraft Inter.
Both fields are varchar and script I use:
SELECT DISTINCT
vndnumber,
vndnumber=MAX(vendorname)
INTO DBO.P_VENDOR
FROM DBO.T_VENDOR
GROUP BY vndnumber