79231940

Date: 2024-11-27 21:38:32
Score: 1.5
Natty:
Report link

I have tried in mysql based on sample data and expected output, syntax should be very similar to Terradata.

Fiddle

SELECT 
    c.customer_number,
    c.ninnbr,
    COUNT(*) OVER (PARTITION BY c.ninnbr) AS unique_count
FROM 
    customers c
ORDER BY 
    c.ninnbr, c.customer_number;

Output

enter image description here

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: samhita