Во-первых, вы можете использовать агрегирование, например так:
with t as (
select t.*,
row_number() over (partition by dm order by (select null)) as seqnum
from <your table> t
)
select max(case when dm = '1000_TEKİRDAĞ TM' then hucre end) as [1000_TEKİRDAĞ TM],
max(case when dm = '10000_TEKIRDAG OB1' then hucre end) as [10000_TEKIRDAG OB1]
max(case when dm = '10100_YAĞCI DM H01_T10' then hucre end) as [10100_YAĞCI DM H01_T10]
from t
group by seqnum;
Вы можете сделать это без агрегирования, используя объединения:
with t as (
select t.*,
row_number() over (partition by dm order by (select null)) as seqnum
from <your table> t
)
select t1.hucre, t2.hucre, t3.hucre
from t t1 left join
t t2
on t2.seqnum = t1.seqnum
t2.dm = '10000_TEKIRDAG OB1' left join
t t3
on t3.seqnum = t1.seqnum
t3.dm = '10100_YAĞCI DM H01_T10' left join
where t1.dm = '1000_TEKİRDAĞ TM';