Click here to Skip to main content
15,921,716 members
Home / Discussions / Database
   

Database

 
GeneralRobust Remote Connections Pin
Roger Wright27-Jun-03 8:49
professionalRoger Wright27-Jun-03 8:49 
GeneralRe: Robust Remote Connections Pin
basementman27-Jun-03 10:26
basementman27-Jun-03 10:26 
GeneralRe: Robust Remote Connections Pin
Roger Wright27-Jun-03 10:57
professionalRoger Wright27-Jun-03 10:57 
GeneralFiltering Distinct information from a DataSet Pin
Jason McBurney27-Jun-03 7:48
Jason McBurney27-Jun-03 7:48 
GeneralRe: Filtering Distinct information from a DataSet Pin
Joshua Nussbaum27-Jun-03 8:42
Joshua Nussbaum27-Jun-03 8:42 
GeneralRe: Filtering Distinct information from a DataSet Pin
Jason McBurney27-Jun-03 9:15
Jason McBurney27-Jun-03 9:15 
GeneralRe: Filtering Distinct information from a DataSet Pin
Joshua Nussbaum27-Jun-03 9:19
Joshua Nussbaum27-Jun-03 9:19 
GeneralCUBE, PIVOT and my head Pin
Paul Watson26-Jun-03 4:58
sitebuilderPaul Watson26-Jun-03 4:58 
I am not a DBA and only know enough SQL to get the job done. Well, most of the time. The rest of the time I wing it and it normally works fine. This time though I am stuck and need your wisdom Smile | :)

Ok I have three tables, Companies, Mailshots and Emails.

In Emails is the Status column which can contain three possible values; Sent, Failed, In Queue.

I need a view which will show me the number of Sent, Failed and In Queue rows for all Mailshots for all Companies.

So the result should be something like this:
Company | Mailshot | Sent | Failed | In Queue
---------------------------------------------
ACME    | ACME101  | 100  | 10     | 150
ACME    | ACME102  | 300  | 10     | 250
ACME    | ACME103  | 0    | 0      | 350


I have been trying to wrap my head around CUBE and PIVOT in SQL but alas God never intended for my brain to grow so big, so I can't (wrap around that is.)

Any help, however obvious, is greatly appreciated. Thank you. *slinks off back to HTML and CSS*

Paul Watson
Bluegrass
Cape Town, South Africa

Robert Edward Caldecott wrote:
My father-in-law calls yer man bits "weasels"
GeneralRe: CUBE, PIVOT and my head Pin
basementman27-Jun-03 3:47
basementman27-Jun-03 3:47 
GeneralRe: CUBE, PIVOT and my head Pin
basementman27-Jun-03 3:49
basementman27-Jun-03 3:49 
GeneralRe: CUBE, PIVOT and my head Pin
Paul Watson3-Jul-03 23:01
sitebuilderPaul Watson3-Jul-03 23:01 
GeneralTrigger problem Pin
Imtiaz Murtaza26-Jun-03 2:33
Imtiaz Murtaza26-Jun-03 2:33 
GeneralRe: Trigger problem Pin
basementman26-Jun-03 4:06
basementman26-Jun-03 4:06 
GeneralRe: Trigger problem Pin
Imtia26-Jun-03 6:48
sussImtia26-Jun-03 6:48 
GeneralRe: Trigger problem Pin
treiber1-Jul-03 8:08
treiber1-Jul-03 8:08 
Generalwhich data type can i use ? for storing a long string. Pin
Asim N.26-Jun-03 2:15
Asim N.26-Jun-03 2:15 
GeneralRe: which data type can i use ? for storing a long string. Pin
Itanium26-Jun-03 2:35
Itanium26-Jun-03 2:35 
GeneralRe: which data type can i use ? for storing a long string. Pin
basementman26-Jun-03 4:09
basementman26-Jun-03 4:09 
GeneralAdding a new record Pin
Itanium26-Jun-03 1:52
Itanium26-Jun-03 1:52 
GeneralWebsite can't access SQL2k DB Pin
-- NA --25-Jun-03 22:21
-- NA --25-Jun-03 22:21 
GeneralRe: Website can't access SQL2k DB Pin
-- NA --26-Jun-03 0:39
-- NA --26-Jun-03 0:39 
GeneralRe: Website can't access SQL2k DB Pin
Rick Crone26-Jun-03 7:51
Rick Crone26-Jun-03 7:51 
GeneralRe: Website can't access SQL2k DB Pin
-- NA --26-Jun-03 7:54
-- NA --26-Jun-03 7:54 
Questionwhich way i should go ? Pin
Asim N.25-Jun-03 18:09
Asim N.25-Jun-03 18:09 
AnswerRe: which way i should go ? Pin
SimonS27-Jun-03 20:40
SimonS27-Jun-03 20:40 

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.