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?

Recommended Answers

All 2 Replies

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.