我有一个表值函数将字符串拆分为3部分,我在我的视图中使用它。
当我使用其中一个部分时,它的工作当前是:
SELECT dbo.Health_Komak2.CDate AS HK2CreatedDateMiladi,----> (select yyyy from dbo.[DateToShamsiSepratePart](dbo.Health_Komak2.CDate)) as xxxxx, Ain74ID,
dbo.Health_Komak2_Paymnets.Price AS HK2Pprice from .......
但是当我使用3部分在视图中显示如下:
SELECT dbo.Health_Komak2.CDate AS HK2CreatedDateMiladi,----> (select yyyy,mm,dd from dbo.[DateToShamsiSepratePart](dbo.Health_Komak2.CDate)) as xxxxx, Ain74ID,
dbo.Health_Komak2_Paymnets.Price AS HK2Pprice from .......
我在SQL server中遇到此错误:
当EXISTS没有引入子查询时,只能在选择列表中指定一个表达式。
如何在主视图中显示 yyyy 和 mm 以及 dd ?
答案 0 :(得分:0)
SELECT ---> c.yyyy,c.mm,c.dd, dbo.tbs_InsuranceCompany.Title AS InsuranceName, dbo.Health_Coverages.Coverages AS HCoveragesName, dbo.Health_Komak2.CDate AS HK2CreatedDateMiladi, dbo.AinName74.Descr AS AinName74Name, dbo.Health_Coverages.Ainame_74_ID AS AinName74ID,
dbo.Health_Komak2_Paymnets.Price AS HK2Pprice FROM dbo.Health_Komak2 INNER JOIN ........> cross apply dbo.[DateToShamsiSepratePart](dbo.Health_Komak2.CDate) c