oracle - Sql query to find rows with different values for some columns -


i have below data in table

    employee id       status       email          partition                       p           a@mail.com      1                      p           a@mail.com      2               d          t           d@mail.com      1             d          t           d@mail.com      2              g           p          g@mail.com      1             g           t          g@mail.com      2 

we expect 3 columns 1 employee should same partition 1 , 2. if there employee either of 3 columns different between partition 1 , 2, 2 records should returned.

for above data, query should return 2 records employee g. please query?

this code return rows, there no partition=2 employee (single record) or fields different in 2 rows.

select t1.*, t2.*  tbl t1     left join tbl t2      on t2.employee_id = t1.employee_id      , t2.partition >  t1.partition t2.employee_id null or t1.status != t2.status  or t1.email != t2.email 

Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -