把sqlserver语句转换成mysql语句
select*into#tfromcm_edmwherecm_status='Yes'insertintocm_edm(edm_sid,edm_hotel,edm_sta...
select * into #t from cm_edm where cm_status='Yes'
insert into cm_edm(edm_sid,edm_hotel,edm_status,type,ecard_page_content,edm_spg_member_status,edm_from)
select edm_sid,edm_hotel,'draft',type,ecard_page_content,edm_spg_member_status,edm_from,case when type = '120notice' then '30notice' else type end from #t 展开
insert into cm_edm(edm_sid,edm_hotel,edm_status,type,ecard_page_content,edm_spg_member_status,edm_from)
select edm_sid,edm_hotel,'draft',type,ecard_page_content,edm_spg_member_status,edm_from,case when type = '120notice' then '30notice' else type end from #t 展开
1个回答
展开全部
第一句是检索数据,创建临时表。
sqlserver
select * into #t from cm_edm where cm_status='Yes'
MySQL
CREATE TEMPORARY TABLE tempT AS
select * from cm_edm where cm_status='Yes';
后面的那句 INSERT INTO。 SQL Server 与 MySQL 的语法是一样的。
insert into cm_edm(edm_sid,edm_hotel,edm_status,type,ecard_page_content,edm_spg_member_status,edm_from)
select edm_sid,edm_hotel,'draft',type,ecard_page_content,edm_spg_member_status,edm_from,case when type = '120notice' then '30notice' else type end from tempT ;
sqlserver
select * into #t from cm_edm where cm_status='Yes'
MySQL
CREATE TEMPORARY TABLE tempT AS
select * from cm_edm where cm_status='Yes';
后面的那句 INSERT INTO。 SQL Server 与 MySQL 的语法是一样的。
insert into cm_edm(edm_sid,edm_hotel,edm_status,type,ecard_page_content,edm_spg_member_status,edm_from)
select edm_sid,edm_hotel,'draft',type,ecard_page_content,edm_spg_member_status,edm_from,case when type = '120notice' then '30notice' else type end from tempT ;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询