我正试图找到一种方法来找出哪些添加的图像已填充Alt和描述字段。 我正试图直接查询master数据库:
USE Fanuc2014_Web;
With EmptyValuedAltFields
AS
(
SELECT I.Name,I.ID, F.Language, F.Value
FROM Items I
INNER JOIN
Fields F ON I.ID = F.ItemId
WHERE
I.TemplateID = '{DAF085E8-602E-43A6-8299-038FF171349F}' AND F.FieldId = '{65885C44-8FCD-4A7F-94F1-EE63703FE193}' AND f.Value = ''
)
Select * FROM EmptyValuedAltFields
但我没有得到正确的结果。除了查询数据库之外还有什么问题,或者我需要调整这个查询吗?
谢谢。
答案 0 :(得分:0)
尝试这样的事情:
SELECT I.Name,I.ID
FROM Items I
WHERE
(I.TemplateID = '{DAF085E8-602E-43A6-8299-038FF171349F}' OR i.TemplateID = '{F1828A2C-7E5D-4BBD-98CA-320474871548}')
AND 0 =
(
SELECT
COUNT(*) FROM Items II INNER JOIN Fields FD ON I.ID = FD.ItemId
WHERE
(FD.FieldId = '{65885C44-8FCD-4A7F-94F1-EE63703FE193}' OR FD.FieldId = '{65885C44-8FCD-4A7F-94F1-EE63703FE193}')
AND i.ID = ii.id
AND fd.Value != ''
)