Geting value count from an Oracle Table

后端 未结 2 1164
忘了有多久
忘了有多久 2021-01-19 17:03

I have a table, that contains employees. Since the company I\'m working for is quite big (>3k employees) It is only natural, that some of them have the same names. Now they

2条回答
  •  走了就别回头了
    2021-01-19 17:15

    Adding the flag to Daniel's answer...

    SELECT NAME, SURNAME, USERNAME, DECODE(COUNT(*) OVER (PARTITION BY NAME, SURNAME), 1, 'N', 'Y')
    FROM
    YOUR_TABLE;
    

    Please note that Oracle SQL has no support for booleans (sigh...)

提交回复
热议问题