i must be going mad today cause i cant even do the simplest of sql!
i have a table called z308. This table looks like this:
Z308_REC_KEY---------------------- CHAR(22)
Z308_VERIFICATION--------------- VARCHAR2(20)
Z308_VERIFICATION_TYPE------- CHAR(2)
Z308_ID------------------------------ VARCHAR2(12)
Z308_STATUS----------------------- CHAR(2)
Z308_ENCRYPTION-----------------CHAR(1)
The Rec_Key is 22 characters long but the first two characters act as an identifier. The rest of the 20 chars are unique.
What I want to do is create a report of z308_ID's that have more than one '01' type of z308_rec_key. the rec_key is the primary key so there is one ID for every unique rec_key.
i.e. list the IDs that have MORE THAN ONE rec_key beginning with '01'.
I know this is simple but i cant seem to think today. Help needed.
btw i use pl/sql so i can use the 'substr' funtion to strip out characters check.
e.g. substr(z308_rec_key,1,2) will return the first 2 chars of z308_rec_key.
i have a table called z308. This table looks like this:
Z308_REC_KEY---------------------- CHAR(22)
Z308_VERIFICATION--------------- VARCHAR2(20)
Z308_VERIFICATION_TYPE------- CHAR(2)
Z308_ID------------------------------ VARCHAR2(12)
Z308_STATUS----------------------- CHAR(2)
Z308_ENCRYPTION-----------------CHAR(1)
The Rec_Key is 22 characters long but the first two characters act as an identifier. The rest of the 20 chars are unique.
What I want to do is create a report of z308_ID's that have more than one '01' type of z308_rec_key. the rec_key is the primary key so there is one ID for every unique rec_key.
i.e. list the IDs that have MORE THAN ONE rec_key beginning with '01'.
I know this is simple but i cant seem to think today. Help needed.
btw i use pl/sql so i can use the 'substr' funtion to strip out characters check.
e.g. substr(z308_rec_key,1,2) will return the first 2 chars of z308_rec_key.