Jul 28, 2004 #1 JRO061601 MIS Joined May 30, 2002 Messages 92 Location US Is it possible to do a count distinct of a concatenation of two numeric columns in DB2? Something like this... COUNT(DISTINCT(NUMBER1 CONCAT NUMBER2)) If so, could you provide the syntax? Thanks.
Is it possible to do a count distinct of a concatenation of two numeric columns in DB2? Something like this... COUNT(DISTINCT(NUMBER1 CONCAT NUMBER2)) If so, could you provide the syntax? Thanks.
Jul 29, 2004 1 #2 gregsimpson Programmer Joined Apr 18, 2002 Messages 521 JR0061601, I accomplished it as follows with a bit of casting to CHAR. My fields were Integers. SELECT COUNT(DISTINCT(CHAR(NUMBER1)||CHAR(NUMBER2))) FROM YOURDB2TABLE; Cheers Greg Upvote 0 Downvote
JR0061601, I accomplished it as follows with a bit of casting to CHAR. My fields were Integers. SELECT COUNT(DISTINCT(CHAR(NUMBER1)||CHAR(NUMBER2))) FROM YOURDB2TABLE; Cheers Greg
Jul 29, 2004 Thread starter #3 JRO061601 MIS Joined May 30, 2002 Messages 92 Location US Cool. Thank you. Upvote 0 Downvote
Jul 30, 2004 #4 stevexff Programmer Joined Mar 4, 2004 Messages 2,110 Location GB Worth a star as far as I can see... Upvote 0 Downvote