How do I compare all the column values based on the Partition by with ID
I have a case where there are many rows for the same ID, I just wanted to know if there is any way to find out whether the given ID includes some specific value or not. Table 1 ID Dept Salary Flag Date 1 IT 5000 N 2017-01-01 1 IT 5000 N 2017-01-02 1 IT 5000 N 2017-01-03 1 IT 5000 N 2017-01-04 1 IT 5000 N 2017-01-05 2 HR 4000 N 2017-01-01 2 HR 4000 N 2017-01-02 2 HR 4000 Y 2017-01-03 2 HR 4000 N 2017-01-04 2 HR 4000 N 2017-01-05 3 Fin 4500 N 2017-01-08 3 Fin 4500 N 2017-01-09 3 Fin 4500 N 2017-01-10 3 Fin 4500 N 2017-01-11 3 Fin 4500 ...