September 23, 2022 at 1:12 pm
I have two unique keys in one table and I want to write a query that connects me to two unique keys and displays them in one record. Right now, the question returns 2 records to me where unique key = ID in the first and unique key = PM in the second record. And I would like to have one record unique key = ID. I want to try the Procedure described here but I'm scared that I am doing wrong. Can someone give some insight here?
i.COLNAMES AS CCOLUMNS, C.TABNAME
FROM syscat.columns C
JOIN SYSCAT.INDEXES I ON I.TABNAME = C.TABNAME
WHERE UNIQUERULE IN ('P','U')
September 24, 2022 at 2:10 pm
Thanks for posting your issue and hopefully someone will answer soon.
This is an automated bump to increase visibility of your question.
September 29, 2022 at 10:12 am
This was removed by the editor as SPAM
September 29, 2022 at 3:00 pm
I have two unique keys in one table and I want to write a query that connects me to two unique keys and displays them in one record. Right now, the question returns 2 records to me where unique key = ID in the first and unique key = PM in the second record. And I would like to have one record unique key = ID. I want to try the Procedure described here but I'm scared that I am doing wrong. Can someone give some insight here?
i.COLNAMES AS CCOLUMNS, C.TABNAME
FROM syscat.columns C
JOIN SYSCAT.INDEXES I ON I.TABNAME = C.TABNAME
WHERE UNIQUERULE IN ('P','U')
This does not run on my SQL Server system (even when prepended with SELECT). Which database platform are you using?
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
September 29, 2022 at 4:20 pm
syscat is DB2
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply