insert select 主键

 string insertAllotSql = string.Format("INSERT INTO `comm_offer_allot` (`offer_id`, `from_type`, `from_id`, `offer_point`, `user_id`, `create_time`) VALUES ({0}, {1}, {2},{3},{4}, {5});select @@IDENTITY  as id;", offerAllot.OfferId, offerAllot.FromType, LibSysUtils.QuoteStr(offerAllot.FromId), offerAllot.OfferPoint, LibSysUtils.QuoteStr(offerAllot.UserId), offerAllot.CreateTime);
            return LibSysUtils.ToInt64(conn.ExecuteScalar(insertAllotSql));

 

posted @ 2021-04-08 10:08  八英里  阅读(162)  评论(0编辑  收藏  举报