Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 the unresolved problem

Author  Topic 

mitasid
Yak Posting Veteran

51 Posts

Posted - 2006-06-08 : 23:56:24
Hi Guys
i have been trying so hard to get an answer for my problem but still havent found a solution
Well my problem is i have got two tables
table 1
Companyname id year volume_for_jan vol_for_feb.....vol_dec
abc 1 2000 34 333 ......555
2 2000 33 22 666

table 2
Companyname id year volume_for_jan vol_for_feb.....vol_dec
rrr 44 2001 55 66.............888
24 2001 22 35 454

each table has almost 800000 rows

I need to generate a report out of these tables which should be in the following format:

Company name Id Year Vol_for_jan Vol_for_feb.........
abc 1 2000 34 33
2 2000 33 22
rrr 44 2001 55 66

How shall i do that???

I dont have any indexes on the tables coz there is no unique field!

Pls help me guys

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-09 : 00:03:24
mitasid,

There have been numerous reply to your post. If that does not gives you want you want, please highlight why it is so rather than keep posting the same question on another post. If you do not explain why other poster does not give you the result you want, we will never know what you really want.

In short, you have to help us to help you. Refer to here http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


KH

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-09 : 00:06:27
reference to other thread of same issue
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=67297
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=67449
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=67200


KH

Go to Top of Page

mitasid
Yak Posting Veteran

51 Posts

Posted - 2006-06-09 : 00:20:09
well the reason y i posted this in new thread was because tkizer did not reply to my last post...and i needed a solution..so i thought i ll put it again..

well these are the insert into statements for my table..

CREATE TABLE Table1 (Funder char, FMIS Code int, Service ID int, Client NHI int, year date,Nov int,Dec int)

INSERT INTO Table1 VALUES('cant',12,333,1212,2000,12,33)
INSERT INTO Table1 VALUES('cant',13,3343,1222,2000,112,233)
INSERT INTO Table1 VALUES('cant',103,5343,22,2000,142,733)
---------------------------------------------------------------
CREATE TABLE Table2 (Funder char, FMIS Code int, Service ID int, Client NHI int, year date,Jan int,feb int...Dec int)

INSERT INTO Table2 VALUES('NEL',112,33,172,2001,11,33,77,88,44,2,8,76,4,56)
INSERT INTO Table2 VALUES('NEL',133,043,172,2001,132,233,8,9,00,55,34,87,9,1)
INSERT INTO Table2 VALUES('NEL',138,943,6,2001,142,733,8,6,7,4,4,2,5,8)

----------------------------------------------------------------------
CREATE TABLE Table3 (Funder char, FMIS Code int, Service ID int, Client NHI int, year date,Jan int,feb int...Dec int)
INSERT INTO Table3 VALUES('NEL',112,33,172,2003,11,33,77,88,44,2,8,76,4,56)
INSERT INTO Table3 VALUES('NEL',133,043,172,2003,132,233,8,9,00,55,34,87,9,1)
INSERT INTO Table3 VALUES('NEL',138,943,6,2003,142,733,8,6,7,4,4,2,5,8)


here is the sample data for the report output..hope it makes it more clear now...

table 1
Companyname id year volume_for_jan vol_for_feb.....vol_dec
abc 1 2000 34 333 ......555
2 2000 33 22 666

table 2
Companyname id year volume_for_jan vol_for_feb.....vol_dec
rrr 44 2001 55 66.............888
4 2001 22 354 54

each table has almost 800000 rows

I need to generate a report out of these tables which should be as follows

Company name Id Year Vol_for_jan Vol_for_feb.........
abc 1 2000 34 33
2 2000 33 22
rrr 44 2001 66 21
..................................................

when i try to run the report in business intelligence ,it takes forever to run and doesnt even produce the report at the end...





Go to Top of Page
   

- Advertisement -