Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

// for select servise_msg_name and date_time on xyz

-----------------------------------------------------------------------------------

select * from [mcom_subscription].[dbo].[Tbl_Service_Message] where


service_message_id IN (
--UPDATE [mcom_subscription].[dbo].[Tbl_Service_Message] SET Broadcast_Date =
'2022-07-06 00:07:00.000' where service_message_id IN (
select service_message_id from (select distinct tm.service_message_id
service_message_id1, tp.Service_Name ,tp.countryCode , tm.*
FROM [mcom_subscription].[dbo].[Tbl_Service_Message] tm
inner join [mcom_subscription].[dbo].[Tbl_Service] tp on
tm.Service_ID=tp.Service_ID
inner join [mcom_subscription].[dbo].Tbl_Service_Package TSP ON TSP.Service_ID =
tm.Service_ID
where Broadcast_Date between '2022-07-06 00:00:00' and '2022-07-06 23:59:59'

-- where [Broadcast_Date] between '2022-07-06 10:00:00' AND '2022-07-06 10:00:00'


--and [Broadcast_Status] ='N'
--AND tm.Service_ID = 618
and tp.countryCode='TH'
and [Service_Message_Status] = 'A'
and [OnProcess] ='N' ) A )
-----------------------------------------------------------------------------------
-------------------------------------------------------------------------

-- Update 3 baht services , every day 3 services set as Y til date 31/7/2022

select * from [mcom_subscription].[dbo].[Tbl_Service_Message] where


service_message_id IN (
update [mcom_subscription].[dbo].[Tbl_Service_Message] SET Broadcast_Status =
'Y',OnProcess = 'Y' where service_message_id IN (
select service_message_id from (select distinct tm.service_message_id
service_message_id1, tp.Service_Name ,tp.countryCode , tm.*
FROM [mcom_subscription].[dbo].[Tbl_Service_Message] tm
inner join [mcom_subscription].[dbo].[Tbl_Service] tp on
tm.Service_ID=tp.Service_ID
inner join [mcom_subscription].[dbo].Tbl_Service_Package TSP ON TSP.Service_ID =
tm.Service_ID
where Broadcast_Date between '2022-07-06 00:00:00' and '2022-09-06 23:59:59'

-- where [Broadcast_Date] between '2022-07-06 10:00:00' AND '2022-07-06 10:00:00'


--and [Broadcast_Status] ='N'
AND tm.Service_ID = 618
and tp.countryCode='TH'
and [Service_Message_Status] = 'A'
and [OnProcess] ='N' ) A )
-----------------------------------------------------------------------------------
---------------------
for updATE BRODCASTE TIME

//

select * from [mcom_subscription].[dbo].[Tbl_Service_Message] where


service_message_id IN (
UPDATE [mcom_subscription].[dbo].[Tbl_Service_Message] SET Broadcast_Date = '2022-
07-06 00:07:00.000' where service_message_id IN (
select service_message_id from (select distinct tm.service_message_id
service_message_id1, tp.Service_Name ,tp.countryCode , tm.*
FROM [mcom_subscription].[dbo].[Tbl_Service_Message] tm
inner join [mcom_subscription].[dbo].[Tbl_Service] tp on
tm.Service_ID=tp.Service_ID
inner join [mcom_subscription].[dbo].Tbl_Service_Package TSP ON TSP.Service_ID =
tm.Service_ID
where Broadcast_Date between '2022-07-06 07:00:00' and '2022-07-06 23:59:59'

-- where [Broadcast_Date] between '2022-07-06 10:00:00' AND '2022-07-06 10:00:00'


--and [Broadcast_Status] ='N'
--AND tm.Service_ID = 618
and tp.countryCode='TH'
and [Service_Message_Status] = 'A'
and [OnProcess] ='N' ) A )

You might also like