Sqlserver 2008 Managementstudio不检查我的查询的语法。和往常一样,我的惊讶会有一个合理的解释,但在那之前.我有个疑问delete from Photo where hs_id in (select hs_id from HotelSupplier where id = 142)它执行得很好(后来我发现整个照片表都是空的)但奇怪的是:没有田野hs_id在HotelSupplier中,它被称为hs_key!所以当我执行最后一部分select hs_id from HotelSupplier where id = 142单独地(用鼠标选择查询的那一部分并按F5),我会得到一个错误,但是当我在in条款,没有!我想知道这是否正常的行为?
3 回答
暮色呼如
TA贡献1853条经验 获得超9个赞
hs_id
select
select 10 from HotelSupplier where id = 142
where
10
Photo
hs_id
delete from Photo where Photo.hs_id in (select Photo.hs_id)
delete from Photo where Photo.hs_id = Photo.hs_id
SET STRICT_CHECKS ON
慕丝7291255
TA贡献1859条经验 获得超6个赞
添加回答
举报
0/150
提交
取消