码迷,mamicode.com
首页 > 数据库 > 详细

mysql 插入replace改变原有数据某些字段

时间:2016-06-27 17:16:53      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

INSERT INTO RPT_TR_CINEMA_TICKET_TRADE_DETAIL(
ID,
TRADE_DATE,
SCINEMA_CD,
OPT_TYPE,
TRADE_CHANL,
FILM_CD,
HALL_CD,
CINEMA_NAME,
FILM_NAME,
SHOW_DATE,
SHOW_TIME,
TICKET_TYPE,
TICKET_GROUP,
BOOKING_ID,
TICKET_NO,
SEQ_NO,
ROW_ID,
COL_ID,
PAYMENT_SEQ,
PAYMENT_TYPE,
PAYMENT_AMT,
PAYMENT_NUM,
TICKET_AMT,
MEMBCARD_NO,
COUPON_TYPE,
SESSION_CODE,
THROUGH_FLG,
OPTER_ID,
OPTER,
REFUND_REASON_DESC,
CRT_DATETIME,
IS_RETURN)
select
REPLACE(uuid(),‘-‘,‘‘),
TRADE_DATE,
‘‘ , -- 影院内码
OPT_TYPE,
TRADE_CHANL,
FILM_CD,
HALL_CD,
‘‘ as CINEMA_NAME, -- 影院名称
FILM_NAME,
SHOW_DATE,
SHOW_TIME,
TICKET_TYPE,
TIC
KET_GROUP,
BOOKING_ID,
TICKET_NO,
SEQ_NO,
ROW_ID,
COL_ID,
PAYMENT_SEQ,
PAYMENT_TYPE,
PAYMENT_AMT,
PAYMENT_NUM,
TICKET_AMT,
MEMBCARD_NO,
COUPON_TYPE,
SESSION_CODE,
THROUGH_FLG,
OPTER_ID,
OPTER,
REFUND_REASON_DESC,
CRT_DATETIME,
IS_RETURN
from RPT_TR_CINEMA_TICKET_TRADE_DETAIL
where SCINEMA_CD=‘1843‘

mysql 插入replace改变原有数据某些字段

标签:

原文地址:http://www.cnblogs.com/zipon/p/5620510.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!