
不确定这是否是解决此问题的最有效或最优雅的方法。但是我终于想到了一种方法。以下解决方案的问题是无法再对其进行索引。因此,现在想一想如何做到这一点,而不必将其包装在派生表中。
SELECt x.ID, x.StatusOrder, x.LanguageID, x.ClientID, x.Other, MAX(x.Description), MAX(x.Disclaimer)FROM ( SELECt Main.ID, s.StatusOrder, f.LanguageID, f.ClientID, f.Description, NULL Disclaimer, Main.Other FROM Main JOIN Fact f ON f.FactID = Main.DescriptionID JOIN Status s ON s.StatusID = f.StatusID UNIOn ALL SELECt Main.ID, s.StatusOrder, f.LanguageID, f.ClientID, NULL Description, f.Description Disclaimer, Main.Other FROM Main JOIN Fact f ON f.FactID = Main.DisclaimerID JOIN Status s ON s.StatusID = f.StatusID) xGROUP BY x.ID, x.StatusOrder, x.LanguageID, x.ClientID, x.Other
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)