read the f*cking source code
SELECT
*
FROM
(
SELECT
ID = row_number () OVER (
partition BY SUPPLIERNAME
ORDER BY
AUDITDATE
),
t.*
FROM
(
SELECT
gys.SUPPLIERNAME,dd.poid,
dd.AUDITDATE,
ht.salesman
FROM
IV_T_SUPPLIER gys,
sm_t_spc ht,
SM_T_SP_DETAIL mx,
SM_T_POC dd
WHERE
gys.SUPPLIERID = ht.supplierid
AND ht.soid = mx.soid
AND mx.POID = dd.POID
AND dd.AUDITDATE > ''
UNION
SELECT
gys.SUPPLIERNAME,dd.poid,
dd.AUDITDATE,
ht.salesman
FROM
PDERP.dbo.IV_T_SUPPLIER gys,
PDERP.dbo.sm_t_spc ht,
PDERP.dbo.SM_T_SP_DETAIL mx,
PDERP.dbo.SM_T_POC dd
WHERE
gys.SUPPLIERID = ht.supplierid
AND ht.soid = mx.soid
AND mx.POID = dd.POID
AND dd.AUDITDATE > ''
) t
WHERE
t.auditdate > '2016-03-15'
AND t.auditdate <= '2016-06-15'
AND t.SUPPLIERNAME NOT IN (
SELECT
tt.SUPPLIERNAME
FROM
(
SELECT
gys.SUPPLIERNAME,
dd.AUDITDATE
FROM
IV_T_SUPPLIER gys,
sm_t_spc ht,
SM_T_SP_DETAIL mx,
SM_T_POC dd
WHERE
gys.SUPPLIERID = ht.supplierid
AND ht.soid = mx.soid
AND mx.POID = dd.POID
UNION
SELECT
gys.SUPPLIERNAME,
dd.AUDITDATE
FROM
PDERP.dbo.IV_T_SUPPLIER gys,
PDERP.dbo.sm_t_spc ht,
PDERP.dbo.SM_T_SP_DETAIL mx,
PDERP.dbo.SM_T_POC dd
WHERE
gys.SUPPLIERID = ht.supplierid
AND ht.soid = mx.soid
AND mx.POID = dd.POID
) tt
WHERE
tt.auditdate <= '2016-03-15'
)
) t2
WHERE
t2.ID = 1
ORDER BY
suppliername
相關文章
- .net source code
- Chrome View Source Code 那些事ChromeView
- Tree – AdaBoost with sklearn source code
- How has JBuilder 8 source codeUI
- SE38 source code ?? 亂碼
- [MYSQL] mysql source code install(5.7.15)MySql
- Windows 95 VxD C Source Code for VANYDEVD (轉)Windowsdev
- TreeView.cs source code in C# .NETViewC#
- Leetcode-Read N Characters Given Read4LeetCode
- ShadowStar CodeFast Source Code 我的生日禮物AST
- [atcoder 349] [F - Subsequence LCM]
- Leetcode-Read N Characters Given Read4 IILeetCode
- Flex Viewer 解析 完整版 (pdf + source code)FlexView
- help ! please send me lomboz3.0.1 source code!
- Codeforces 1487F Ones
- From BIO to NIO series —— BIO source code interpretation
- From BIO to NIO —— NIO source code interpretation 1
- Vue 3 Reactivity System Source Code Reading: `markRaw`VueReact
- Source Code for Unity3D Course Example ApplicationsUnity3DAPP
- AtCoder-abc345_f題解
- OSC Source Code Innovation Salon(2018.10.20)
- LeetCode之All Paths From Source to Target(Kotlin)LeetCodeKotlin
- Source Code Reading for Vue 3: How does `hasChanged` work?Vue
- LIRE教程之原始碼分析 | LIRE Tutorial of Analysis of the Source Code原始碼
- [LeetCode] 158. Read N Characters Given Read4 II – Call multipleLeetCode
- LeetCode-Read N Characters Given Read4 II - Call multiple timesLeetCode
- Codeforces 1485F Copy or Prefix Sum
- AtCoder Beginner Contest 192 F - Potion
- CF 240F TorCoder(線段樹)
- Codeforces 1530F. BingoGo
- mysql source code源代安裝的前提條件requirementMySqlUIREM
- Linux Kernel File IO Syscall Kernel-Source-Code Analysis(undone)Linux
- AtCoder Beginner Contest 238 A - F 題解
- AtCoder Beginner Contest 187 F - Close Group
- AtCoder Beginner Contest 345 A-F 題解
- UI5 Source code map機制的細節介紹UI
- Codeforces 1863F Divide, XOR, and ConquerIDE
- Library source does not match the bytecode for class 最佳解決方案