This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE [FPSA] | |
GO | |
/****** Object: View [dbo].[AGG_TRANSACTION] Script Date: 27-09-2017 13:28:07 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/****** Object: Table [dbo].[AGG_UNUSEDCARDS] Script Date: 14-06-2017 13:55:06 ******/ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE TABLE [dbo].[AGG_UNUSEDCARDS]( | |
[LEVEL] [varchar](50) NULL, | |
[GEOGRAPHY] [varchar](255) NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from (SELECT 'FPS' Level ,sh.SHOP_NO Geography | |
,CASE | |
WHEN st.PRODUCT_ID = 1 | |
THEN sum(qty) | |
ELSE 0 | |
END Rice_PH | |
,CASE | |
WHEN st.PRODUCT_ID = 2 | |
THEN sum(qty) | |
ELSE 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
insert into x_devices | |
SELECT level2 | |
,'Jun' Month | |
,sum(installed) installed | |
,sum(connected) connected | |
,sum(transacted) transacted | |
FROM ( | |
SELECT level2 | |
,1 installed | |
,CASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete from TRANSACTION_DETAILS_P where TR_SEQ_NO in(select TR_SEQ_NO from TRANSACTION_MASTER_P where ard_no='122999') | |
delete from TRANSACTION_MASTER_P where ard_no='122999' | |
delete from FAILED_TRANSACTIONS_TRAILER_P where TR_SEQ_NO in(select TR_SEQ_NO from FAILED_TRANSACTIONS_P where SHOP_NO ='122999') | |
delete from FAILED_TRANSACTIONS_P where SHOP_NO ='122999' |