sql语句出错??

来源:百度知道 编辑:UC知道 时间:2024/05/31 12:35:17
create trigger A
on in_out
after insert
as
if update (io_id)
update book set book_state="out" where book_id =in_out.book_id
and io_id =select top 1 io_id Order By io_id asc

执行时 'select' 附近有语法错误,不明白,请高手指教

要把你的子查询括起来,还有就是,你的子查询语法出错,没有写明从哪个表里查出io_id这个字段.
and io_id =(select top 1 io_id from 填写你的表名 Order By io_id asc )
改成上面那样,把你的表名填写就行了

最后一句改为
and io_id =(select top 1 io_id Order By io_id asc)