通过一些语句查询得到了一个表select BookName,BookNo, case Motion when '归还' then '在架' else '已借出' end as condition,Launcher as Borrower
from BorrowAndReturn
where HistoryID in (select Max(HistoryID) from BorrowAndReturn group by BookNo)得到的表如下:
BookName BookNo condtion Borrower
趣谈 31 在架 swer
就好 54 已借出 luck
的撒旦啊 321 在架 blamer现在我想把所有condition字段为‘在架’的记录中的Borrower字段改成‘无’,只在当前的语句里添加修改,怎么完成呢?
from BorrowAndReturn
where HistoryID in (select Max(HistoryID) from BorrowAndReturn group by BookNo)得到的表如下:
BookName BookNo condtion Borrower
趣谈 31 在架 swer
就好 54 已借出 luck
的撒旦啊 321 在架 blamer现在我想把所有condition字段为‘在架’的记录中的Borrower字段改成‘无’,只在当前的语句里添加修改,怎么完成呢?
case Motion when '归还' then '无' else Launcher end Borrower
from BorrowAndReturn
where HistoryID in (select Max(HistoryID) from BorrowAndReturn group by BookNo)
set Launcher ='无'
where Motion ='归还' and HistoryID in (select Max(HistoryID) from BorrowAndReturn group by BookNo)
from BorrowAndReturn
where HistoryID in (select Max(HistoryID) from BorrowAndReturn group by BookNo)
borrower 'xxxx' where where 你搜索出来的条件。
from BorrowAndReturn
where HistoryID in (select Max(HistoryID) from BorrowAndReturn group by BookNo)