You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DS7/DSWeb/Areas/Account/Files/CCHN23110446/20231227154237_4999.sql

98 lines
5.4 KiB
MySQL

1 year ago
select COUNTRYID_3,* from code_country where COUNTRY like '<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɷ<EFBFBD><EFBFBD><EFBFBD>%'
select country,GOODSNAME, * from op_wms_in_plan where mblno='DLA300007100'
select GOODSNAME, * from OP_WMS_IN_PLAN_GOODS where mblno='DLA300007100'
select country,GOODSNAME,* from op_wms where mblno='DLA300007100'
select country,GOODSNAME,* from OP_WMS_BASE where mblno='DLA300007100'
select country,GOODSNAME, * from op_wms_in_plan where COUNTRY='TCD' and GOODSNAME<>'է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
update OP_WMS_IN_PLAN_GOODS set GOODSNAME='է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' where WMSPLANID in(
select WMSPLANID from op_wms_in_plan where COUNTRY='TCD' and GOODSNAME<>'է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
)
update op_wms_in_plan set GOODSNAME='է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' where COUNTRY='TCD' and GOODSNAME<>'է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
--select country,GOODSNAME,* from op_wms where mblno='DLA300007100'
update op_wms set GOODSNAME='է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' where WMSBASEID in(
select WMSBASEID from OP_WMS_BASE where COUNTRY='TCD' and GOODSNAME<>'է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
)
update OP_WMS_BASE set GOODSNAME='է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' where COUNTRY='TCD' and GOODSNAME<>'է<EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
update op_wms_in_do set GOODSNAME=(select top 1 GOODSNAME from op_wms_in_plan where MBLNO=op_wms_in_do.MBLNO)
where GOODSNAME<>(select top 1 GOODSNAME from op_wms_in_plan where MBLNO=op_wms_in_do.MBLNO)
select GOODSNAME,(select top 1 GOODSNAME from op_wms_in_plan where MBLNO=op_wms_in_do.MBLNO) from op_wms_in_do
where GOODSNAME<>(select top 1 GOODSNAME from op_wms_in_plan where MBLNO=op_wms_in_do.MBLNO)
select * from code_country where COUNTRY like '%<25><>%'
select GOODSNAME,COUNTRY,(select COUNTRY from code_country where COUNTRYID_3=OP_WMS_IN_PLAN.COUNTRY),
(case when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'USA' when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'AUS' else(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_IN_PLAN.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )end),
* from OP_WMS_IN_PLAN where GOODSNAME like '%<25><>'
and country <>(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_IN_PLAN.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )
and ((GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'USA') or (GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'AUS') or GOODSNAME<>'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
select GOODSNAME,COUNTRY,(select COUNTRY from code_country where COUNTRYID_3=OP_WMS_IN_PLAN.COUNTRY),
(case when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'USA' when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'AUS' else(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_IN_PLAN.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )end),
* from OP_WMS_IN_PLAN where len( op_wms_in_plan.COUNTRY)=2
select country,GOODSNAME, * from op_wms_in_plan where COUNTRY<>'BFA' and GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
update op_wms_in_plan set COUNTRY='BFA' where COUNTRY<>'BFA' and GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
update op_wms set COUNTRY='BFA' where WMSBASEID in(
select WMSBASEID from OP_WMS_BASE where COUNTRY<>'BFA' and GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
)
update OP_WMS_BASE set COUNTRY='BFA' where COUNTRY<>'BFA' and GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
update op_wms_in_plan set COUNTRY=(case when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'USA' when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'AUS' else(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_IN_PLAN.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )end)
where GOODSNAME like '%<25><>'
and country <>(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_IN_PLAN.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )
and ((GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'USA') or (GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'AUS') or GOODSNAME<>'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
update op_wms_in_do set COUNTRY=(case when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'USA' when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'AUS' else(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_IN_PLAN.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )end)
where GOODSNAME like '%<25><>'
and country <>(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_IN_PLAN.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )
and ((GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'USA') or (GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'AUS') or GOODSNAME<>'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
update op_wms set COUNTRY=(case when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'USA' when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'AUS' else(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(op_wms.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )end) where WMSBASEID in(
select WMSBASEID from OP_WMS_BASE where GOODSNAME like '%<25><>'
and country <>(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_BASE.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )
and ((GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'USA') or (GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'AUS') or GOODSNAME<>'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
)
update OP_WMS_BASE set COUNTRY=(case when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'USA' when GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' then 'AUS' else(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_BASE.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )end)
where GOODSNAME like '%<25><>'
and country <>(select top 1 COUNTRYID_3 from code_country where COUNTRY like '%'+REPLACE(OP_WMS_BASE.GOODSNAME,'<EFBFBD><EFBFBD>','')+'%' )
and ((GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'USA') or (GOODSNAME='<EFBFBD><EFBFBD><EFBFBD><EFBFBD>' and COUNTRY<>'AUS') or GOODSNAME<>'<EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
select GOODSNAME,COUNTRY,(select COUNTRYID_3 from code_country where COUNTRYID=OP_WMS_IN_PLAN.COUNTRY),* from op_wms_in_plan where len(COUNTRY)=2
update op_wms_in_plan set COUNTRY='CHN' where COUNTRY='<EFBFBD>й<EFBFBD>'
update op_wms set COUNTRY='CHN' where COUNTRY='<EFBFBD>й<EFBFBD>'
update OP_WMS_BASE set COUNTRY='CHN' where COUNTRY='<EFBFBD>й<EFBFBD>'
update op_wms_in_plan set COUNTRY=(select top 1 COUNTRYID_3 from code_country where COUNTRYID=op_wms_in_plan.COUNTRY) where len(COUNTRY)=2
update op_wms set COUNTRY=(select top 1 COUNTRYID_3 from code_country where COUNTRYID=op_wms.COUNTRY) where len(COUNTRY)=2
update OP_WMS_BASE set COUNTRY=(select top 1 COUNTRYID_3 from code_country where COUNTRYID=OP_WMS_BASE.COUNTRY) where len(COUNTRY)=2