There are several columns in the selection query, checking the query for uniqueness across all columns, not just in brackets.
The SQL DISTINCT keyword is used with the SELECT statement to eliminate all duplicate records and retrieve only unique records . . Please note that these are not just columns.
If you change your request to this:
SELECT DISTINCT (TK.TICKETID), TK.DESCRIPTION, TK.CREATIONDATE, TK.REPORTEDBY, TK.OWNER FROM ticket TK INNER JOIN wfassignment WF on WF.OWNERID = TK.TICKETUID WHERE TK.status not in ('', '', '') AND WF.ASSIGNSTATUS not in ('COMPLETE', 'INACTIVE') ORDER BY TK.TICKETID;
You will get only one result.
In the conclusion, please pay attention to the following: the marked stars are all different.
TK.TICKETID TK.DESCRIPTION TK.CREATIONDATE TK.REPORTEDBY TK.OWNER **WF.ASSIGNCOD**E 1013249 02.06.14 CHERNOVDK SKACHKOVSV **NOVIKOVVA** 1013249 02.06.14 CHERNOVDK SKACHKOVSV **PRITULADV** 1013249 02.06.14 CHERNOVDK SKACHKOVSV **SVESHNIKOVAV**
source share