0

I would need to find a way to identify lines that are the same.

The comparison must be made on the first 4 columns (A-B-C-D) If these are identical I would like to identify them by inserting 1 in column E and if they are different by inserting 0, as a byte flag.

Thank you in advance for your help.

enter image description here

3
  • For query-writing questions, please follow the advice about question contents
    – vonPryz
    Commented Oct 17, 2023 at 12:47
  • Is this a database question or an Excel question?...if the former, what database system and version?
    – J.D.
    Commented Oct 17, 2023 at 14:47
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Commented Oct 18, 2023 at 5:31

1 Answer 1

0

On any modern DBMS with window functions you can just do

CASE WHEN
  COUNT(*) OVER (PARTITION BY Project, Activity, Ressource, Factor) > 1
  THEN 1 ELSE 0 END

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.