Wilder1626
asked on
SQL - Query Location table where ADDR1 have duplicated values
Hello all
I'm trying to extract from my LOCATION table all locations that have duplicated values in column ADDR1 field but using the SQL below.
But i have this error: ORA-00933: SQL command not properly ended
How can i fix this?
Thanks again for your help.
I'm trying to extract from my LOCATION table all locations that have duplicated values in column ADDR1 field but using the SQL below.
But i have this error: ORA-00933: SQL command not properly ended
How can i fix this?
Thanks again for your help.
SELECT CNT,
'L' AS L,
'M' AS M,
ID,
DECODE (LOC_TYPE_ID,
0,
'PLAN',
1,
'CUSTOMER',
2,
'VENDOR',
3,
'DIST',
5,
'CROSSDOCK')
AS LOC_TYPE_ID,
NAME,
ADDR1,
ADDR2,
CITY,
STATE,
COUNTRY,
ZIP,
CONTACT,
PHONE,
PHONE_SPD,
FAX,
LATITUDE,
LONGITUDE,
ZONE,
PU_STOPTM,
DEL_STOPTM,
APPOINTMENT_REQUIRED,
TIME_ZONE_ID,
LOAD_CLASS_ID,
CONSOLIDATION_ALLOWED,
PARCEL_SERVICE,
LOCATION_GROUP,
MAX_CROSSDOCK_DAYS,
PARCEL_CARRIER,
ALT_LOCATION_ID,
LOC_ROUTING_CLASS_ID,
PICK_SRV_CLASS_ID,
DELV_SRV_CLASS_ID,
SPLC,
APPOINTMENT_HONORED,
SPLIT_WEIGHT,
SPLIT_CUBE,
SPLIT_PALLET,
SPLIT_PIECES,
SET_ID,
SHIP_PRIORITY_ID,
EMAIL,
TRADE_AREA,
SCNALIAS,
XDOCK_HANDLING_TIME,
SHPPTY,
XDOCK_LIVE_LOADING,
OWNER,
PORT_CODE,
NOTES
FROM LOCATION
(
SELECT COUNT(*) CNT,
ADDR1
FROM
LOCATION
-GROUP BY ADDR1
HAVING COUNT > 1;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER