必须显示图片中的所有检查项目。
这是我的sql语句。
SELECT DISTINCT
c.code || ' - ' || c.description || ' - ' || s.num AS SearchColumn,
s.num AS Num,
c.code AS Code,
c.product AS Product,
f.faciltyname AS FacilityName,
f.facilityid AS FacilityID,
c.description AS Description,
c.Number AS Num
FROM Facility f
JOIN Code c ON f.codeid = c.codeid
JOIN Structure s ON c.structureid = s.structureid
WHERE searchcolumn > ""
AND ((c.product = 'PROD1' OR c.product IS NULL ))
ORDER BY c.code ASC
它们只是从代码,num和productid(它们也有特殊情况)中复制而来,但实际上它们具有所需的不同的工具ID和工具名称