Skip to content

Instantly share code, notes, and snippets.

View BhargaviTelpunuri's full-sized avatar

BhargaviTelpunuri

View GitHub Profile
@BhargaviTelpunuri
BhargaviTelpunuri / delete data from transactions
Last active July 20, 2017 05:29
delete data from transactions
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'
@BhargaviTelpunuri
BhargaviTelpunuri / q
Last active June 6, 2017 10:52
q uid response codes
insert into x_devices
SELECT level2
,'Jun' Month
,sum(installed) installed
,sum(connected) connected
,sum(transacted) transacted
FROM (
SELECT level2
,1 installed
,CASE
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
/****** 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,
@BhargaviTelpunuri
BhargaviTelpunuri / agg_tran view
Created September 27, 2017 08:03
agg_tran view
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