我试图更新具有place_id(fk)的每一行,但db表示select的结果有多行。当然它确实有一行,因为我试图更新列,而不仅仅是一条记录。
update Event set placeListingName =
(select substr(coalesce(epc.shortTitle, epc.title),1,100)
from Event e join e.place p join p.publicContent epc
where e.place is not null)
where place is not null
括号中的表达式(选择...其中e.place不为null)运行良好并返回字符串列表
答案 0 :(得分:0)
如果有兴趣:
update Event e set e.placeListingName =
(select substr(coalesce(epc.shortTitle, epc.title),1,100)
from Event ev join ev.place p join p.publicContent epc
where ev.id = e.id)
where e.place is not null