我在表assets上,我想将每个code列更新为表的'ASSET000'+ primary id,如下所示
Asset0001 for id 1
Asset0002 for id 2
Asset0003 for id 3在mysql中,查询将是
UPDATE assets SET code = concat('ASSET000', id)我怎么用拉拉维尔写?
DB::table('assets')->update('code',????)发布于 2018-01-09 08:54:47
使用DB::raw(),您可以这样做:
DB::table('assets')->update(['code' => DB::raw( CONCAT('ASSET000', id) )])https://stackoverflow.com/questions/48164315
复制相似问题