SELECT A.CABLE_NO,A.LOC_A,A.LOC_B, iif(isnull(B.LENGTH,'SITE',B.LENGTH) AS CABLE_LENGTH
FROM TABLE_A AS A, TABLE_B AS B
WHERE A.id =B.id
我想修改上面的代码,以便与MS Access / JET数据库引擎一起使用,
表A包含电缆号和位置a和位置b
列,而表B
包含长度,某些长度字段为空,即null
,
我想在查询结果中将NULL
值替换为SITE
。
答案 0 :(得分:0)
SELECT A.CABLE_NO,A.LOC_A,A.LOC_B,
ISNULL(B.LENGTH,'SITE') AS CABLE_LENGTH
FROM TABLE_A AS A, TABLE_B AS B
WHERE A.id =B.id