| only show the duplicated records [message #640730] |
Tue, 04 August 2015 11:08  |
 |
ajen7118
Messages: 3 Registered: July 2015
|
Junior Member |
|
|
Hi,
I have a query below to show all the records with joining these two tables.
SELECT DISTINCT B.BF_ORGN_CD, B.LEV5, A.BF_ACTY_CD
FROM BF_ORGN A
INNER JOIN BF_ORGN_CNSL_TBL B
ON A.CD=B.BF_ORGN_CD
WHERE A.BF_ACTY_CD IS NOT NULL
ORDER BY B.BF_ORGN_CD,A.BF_ACTY_CD
My goal is only to show all the duplicate records. Can anyone help me on this? Thank you very much.
Bf_ORGN_CD LEV5 BF_ACTY_CD
AC_21234_2 AC_21200_1 402
AC_21236_2 AC_21200_1 402
AC_21238_2 AC_21200_1 402
AC_29000_1 AC_29000_1 802 ---> NOT SHOW (ONLY 1 RECORD)
AC_29988_1 AC_29988_1 801 ---> NOT SHOW (ONLY 1 RECORD)
AC_40040_1 AC_40040_1 201 ---> NOT SHOW (ONLY 1 RECORD)
AC_41061_1 CA_41061_1 207 ---> NOT SHOW (ONLY 1 RECORD)
AC_41080_1 AC_41080_1 207 ---> NOT SHOW (ONLY 1 RECORD)
AC_41196_1 AC_41196_1 207 ---> NOT SHOW (ONLY 1 RECORD)
AC_42404_1 AC_42404_1 801 ---> NOT SHOW (ONLY 1 RECORD)
AC_42405_1 AC_42405_1 801 ---> NOT SHOW (ONLY 1 RECORD)
AC_53980_1 AC_53980_1 207
AC_53982_2 AC_53980_1 207
|
|
|
|
|
|
|
|
|
|
|
|