I am using SQL Server 2008. I have data from SQL like this.

ID ID2 PartNo
-- ---- ----
75 23921 DENT
75 26145 PLGD
75 26145 PRRP
75 26145 SIST
75 57290 PRMD
75 57290 abc
75 57290 def
75 57290 ghi
75 57290 jkl

I need an output like this

ID          ID2         DENT       PLGD       PRRP       SIST
----------- ----------- ---------- ---------- ---------- ----------
75          23921       1          0          0          1
75          26145       1          0          1          0
75          57290       0          1          0          1

is OVER(Partition By) applicable?

what is the query that you are working on ?

Whats the difference between this thread and this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.