 |
|
ต้องการแปลงจาก sql เป็น linq รบกวนพูดรู้ช่วยที่ครับ ขอบคุณมากครับ
select OriginalDocumentNumber ,FilterRound , p2_Reason , p2_FinalGrade , rowno , s_index , t_index
from (
select * ,
rowno=row_number() over (partition by OriginalDocumentNumber,FilterRound order by p2_FinalGrade desc) ,
s_index = ROW_NUMBER() OVER(PARTITION BY FilterRound,OriginalDocumentNumber ORDER BY p2_FinalGrade),
t_index = DENSE_RANK() OVER (ORDER BY p2_FinalGrade)
from #TempDa
) l
where
l.p2_FinalGrade in ('d','f')
and l.rowno = 1
and l.OriginalDocumentNumber = '590200054'
and l.p2_Reason = 'ไกลเกินไป/กำลังซื้อน้อย'
and l.OriginalDocumentNumber+l.FilterRound not in (select OriginalDocumentNumber+FilterRound from #TempDa where p2_FinalGrade in ('a','b','c')
)
Tag : .NET, Ms SQL Server 2012, LINQ, C#
|
|
 |
 |
 |
 |
Date :
2016-04-25 16:07:47 |
By :
thewinner55 |
View :
851 |
Reply :
1 |
|
 |
 |
 |
 |
|
|
|
 |