Skip to content

Instantly share code, notes, and snippets.

@carpii
Created August 14, 2013 22:00
Show Gist options
  • Save carpii/6236099 to your computer and use it in GitHub Desktop.
Save carpii/6236099 to your computer and use it in GitHub Desktop.
Create and populate 'finance' table, which represents the resultset after your original query has run This is the same data you gave me, except I only need the amount and type fields (you'd also include the date field, but I had to just use dummy data for that)
CREATE TABLE [finance] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[amount] [decimal](10, 4) NULL ,
[type] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
insert into finance (amount, type) values (0.0000,'PRINCIPAL');
insert into finance (amount, type) values (150.0000,'PRINCIPAL');
insert into finance (amount, type) values (100.0000,'PRINCIPAL');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (59.4000,'PAYMENT');
insert into finance (amount, type) values (200.0000,'PRINCIPAL');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (78.5700,'PAYMENT');
insert into finance (amount, type) values (250.0000,'PRINCIPAL');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (92.5400,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (90.4200,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (50.0000,'PRINCIPAL');
insert into finance (amount, type) values (200.0000,'PRINCIPAL');
insert into finance (amount, type) values (87.4900,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (80.7800,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (200.0000,'PRINCIPAL');
insert into finance (amount, type) values (80.2600,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (88.1100,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (89.8000,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (80.1400,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (88.1100,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (87.2300,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (86.1600,'PAYMENT');
insert into finance (amount, type) values (86.1600,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (85.1100,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (84.0800,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (83.0700,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (82.0800,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (81.1100,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (80.1700,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (79.2400,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (78.3300,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (74.5200,'PAYMENT');
insert into finance (amount, type) values (25.0000,'FEE');
insert into finance (amount, type) values (99.5200,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (104.7000,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (75.1000,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (300.0000,'PRINCIPAL');
insert into finance (amount, type) values (73.4500,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (84.0500,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (86.2200,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (81.8500,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (87.3900,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (83.0500,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (100.0000,'PRINCIPAL');
insert into finance (amount, type) values (82.0000,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (84.9900,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (84.7700,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (83.6900,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (79.4900,'PAYMENT');
insert into finance (amount, type) values (25.0000,'FEE');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (30.0000,'FEE');
insert into finance (amount, type) values (219.7500,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (81.0200,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (79.5100,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (150.0000,'PRINCIPAL');
insert into finance (amount, type) values (75.6600,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (86.6300,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (80.6100,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (85.8000,'PAYMENT');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (81.6200,'PAYMENT');
insert into finance (amount, type) values (25.0000,'FEE');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (30.0000,'FEE');
insert into finance (amount, type) values (217.7500,'PAYMENT');
insert into finance (amount, type) values (25.0000,'FEE');
insert into finance (amount, type) values (35.0000,'FEE');
insert into finance (amount, type) values (30.0000,'FEE');
insert into finance (amount, type) values (40.0000,'FEE');
insert into finance (amount, type) values (93.8700,'PAYMENT');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment