INSERT INTO [BOOnboardingStatus]
(BusinessID,
SectionID,
SectionName,
SubSectionID,
SubSectionName,
status,
createdby,
modifieddate,
modifiedby,
source,
createddate)
SELECT contentid,
2,
'Additional Info',
'22',
'Add keywords',
(SELECT CASE
WHEN categoryname IS NOT NULL THEN 1
ELSE 0
END
FROM businesscategory
WHERE businessid IN(SELECT contentid
FROM businessmaster
WHERE isclaim = 1)
AND [primary] = 1),
1,
Getdate(),
0,
'BOD',
Getdate()
FROM businessmaster
WHERE isclaim = 1
答案 0 :(得分:0)
据推测,您需要一个相关的子查询:
mysqli_close($this->link);
编辑:
也许SELECT contentid, 2, 'Additional Info', '22', 'Add keywords',
(SELECT CASE WHEN categoryname IS NOT NULL THEN 1
ELSE 0
END
FROM businesscategory bc
WHERE bc.businessid = bm.contentid AND
bc.[primary] = 1
),
1, Getdate(), 0, 'BOD', Getdate()
FROM businessmaster bm
WHERE isclaim = 1 ;
可以满足您的需求。它肯定会摆脱错误:
EXISTS