无法确定为什么在运行查询时出现此错误
我遇到错误:
无效的标识符IN_LIBRARY
Select distinct ci.Title, ci.publisher, b.isbn, ci.Release_date, b.Pages,
IN_LIBRARY,
case when exists( select * from Physical_Item where pi.catalog_item_id
=ci.catalog_item_id)
then 'yes' else 'No'
end
as IN_LIBRARY
from Catalog_Item ci
left join book b on ci.CATALOG_ITEM_ID = b.Catalog_item_ID
left join physical_item pi
on pi.catalog_item_id =ci.CATALOG_ITEM_ID
order by ci.title;
答案 0 :(得分:0)
在案例陈述前的选择列表中删除IN_LIBRARY,更正了以下查询:
Select distinct ci.Title, ci.publisher, b.isbn, ci.Release_date, b.Pages,
case when exists( select * from Physical_Item where pi.catalog_item_id
=ci.catalog_item_id)
then 'yes' else 'No'
end
as IN_LIBRARY
from Catalog_Item ci
left join book b on ci.CATALOG_ITEM_ID = b.Catalog_item_ID
left join physical_item pi
on pi.catalog_item_id =ci.CATALOG_ITEM_ID
order by ci.title;