Click here to Skip to main content
16,012,223 members
Home / Discussions / Database
   

Database

 
QuestionOledbparameter names with spaces Pin
GrindEspresso23-Aug-06 14:48
GrindEspresso23-Aug-06 14:48 
AnswerRe: Oledbparameter names with spaces Pin
Navi1523-Aug-06 19:03
Navi1523-Aug-06 19:03 
GeneralRe: Oledbparameter names with spaces Pin
GrindEspresso23-Aug-06 21:09
GrindEspresso23-Aug-06 21:09 
QuestionWhat is the simplest statement to insert a bitmap into Image column? Pin
pedestrian79723-Aug-06 13:55
pedestrian79723-Aug-06 13:55 
AnswerRe: What is the simplest statement to insert a bitmap into Image column? Pin
Jerry Hammond23-Aug-06 17:01
Jerry Hammond23-Aug-06 17:01 
QuestionDynamic EXEC [modified] Pin
em00guy23-Aug-06 8:28
em00guy23-Aug-06 8:28 
AnswerRe: Dynamic EXEC Pin
em00guy23-Aug-06 9:47
em00guy23-Aug-06 9:47 
QuestionHierarchical Rollup Help (SQL Server 2005) Pin
T-Smooth23-Aug-06 6:48
T-Smooth23-Aug-06 6:48 
I have a table consisting of 3 columns: Parent varchar(50), Child varchar(50), Pop int.

The table is setup as follows:

Parent Child Pop
----------------------------------
Europe France 0
France Paris 1
New York New York City 10
North America United States 0
North America Canada 0
United States New York 0
United States Washington 0
Washington Redmond 200
Washington Seattle 100
World Europe 0
World North America 0

This is just some sample data modified a tiny bit from an example of a hierachical print out sample that is a stored procedure that allows me to pass any place and see all of that place's children/grandchildren.

I need to figure out how to write a query to show me cumulative sums (ROLLUP?) of the whole tree. So the output should basically be something like this (it can include parent and child columns too):

World Null 311
World Europe 1
Europe France 1
France Paris 1
World North America 310
North America United States 310
North America Canada 0
United States New York 10
United States Washington 300
New York New York City 10
Washington Redmond 200
Washington Seattle 100

Hopefully you understand what i'm looking for. I've tried using WITH ROLLUP and I also tried using an Inner Join but I'm not really sure what I need to do to pull this off. I seem to only be able to get it to work 1-2 levels deep but not through the whole tree.

Any help/ideas would be appreciated! Thank you.


AnswerRe: Hierarchical Rollup Help (SQL Server 2005) Pin
Eric Dahlvang24-Aug-06 4:26
Eric Dahlvang24-Aug-06 4:26 
QuestionFill my Report (Crystal Report) Pin
Schimaera22-Aug-06 23:48
Schimaera22-Aug-06 23:48 
AnswerRe: Fill my Report (Crystal Report) Pin
Schimaera24-Aug-06 2:03
Schimaera24-Aug-06 2:03 
GeneralRe: Fill my Report (Crystal Report) Pin
Schimaera24-Aug-06 22:10
Schimaera24-Aug-06 22:10 
QuestionSimple problem but irriatating me Pin
sandeep kumar pundhir22-Aug-06 21:37
sandeep kumar pundhir22-Aug-06 21:37 
AnswerRe: Simple problem but irriatating me [modified] Pin
Mike Dimmick23-Aug-06 0:08
Mike Dimmick23-Aug-06 0:08 
QuestionCSV to Tab Delimiter file Pin
Yong Yau22-Aug-06 20:52
Yong Yau22-Aug-06 20:52 
AnswerRe: CSV to Tab Delimiter file Pin
Mike Dimmick23-Aug-06 0:19
Mike Dimmick23-Aug-06 0:19 
Questionquery Pin
dayakar_dn22-Aug-06 20:36
dayakar_dn22-Aug-06 20:36 
AnswerRe: query Pin
Eric Dahlvang23-Aug-06 5:10
Eric Dahlvang23-Aug-06 5:10 
Questionhow to configure a SQL Server 2000 that syncronize the data with Microsoft SQL Server 2000 Enterprise Manager [modified] Pin
Vartika Srivastava22-Aug-06 20:17
Vartika Srivastava22-Aug-06 20:17 
QuestionBulk Insert Pin
Yong Yau22-Aug-06 17:47
Yong Yau22-Aug-06 17:47 
QuestionAccessing local database created in VS 2005 [modified] Pin
Libor Tinka22-Aug-06 7:00
Libor Tinka22-Aug-06 7:00 
AnswerRe: Accessing local database created in VS 2005 Pin
Mike Dimmick22-Aug-06 23:59
Mike Dimmick22-Aug-06 23:59 
QuestionDouble field name in select statement [modified] Pin
Paddy Boyd22-Aug-06 3:14
Paddy Boyd22-Aug-06 3:14 
AnswerRe: Double field name in select statement Pin
Colin Angus Mackay22-Aug-06 5:04
Colin Angus Mackay22-Aug-06 5:04 
GeneralRe: Double field name in select statement Pin
Paddy Boyd22-Aug-06 5:08
Paddy Boyd22-Aug-06 5:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.