Click here to Skip to main content
15,896,557 members
Home / Discussions / Database
   

Database

 
GeneralRe: SQL Query Pin
Blue_Boy1-Apr-08 9:17
Blue_Boy1-Apr-08 9:17 
GeneralRe: SQL Query Pin
Ali Rashid1-Apr-08 22:05
Ali Rashid1-Apr-08 22:05 
GeneralRe: SQL Query Pin
Blue_Boy2-Apr-08 7:43
Blue_Boy2-Apr-08 7:43 
GeneralRe: SQL Query [modified] Pin
Syed Mehroz Alam2-Apr-08 9:30
Syed Mehroz Alam2-Apr-08 9:30 
GeneralRe: SQL Query Pin
Blue_Boy3-Apr-08 12:14
Blue_Boy3-Apr-08 12:14 
AnswerRe: SQL Query Pin
mushfiqcs2-Apr-08 1:10
mushfiqcs2-Apr-08 1:10 
GeneralRe: SQL Query Pin
mushfiqcs2-Apr-08 1:10
mushfiqcs2-Apr-08 1:10 
QuestionRAM usage Pin
Dobromir Dimitrov31-Mar-08 21:55
Dobromir Dimitrov31-Mar-08 21:55 
GeneralRe: RAM usage Pin
GuyThiebaut31-Mar-08 23:56
professionalGuyThiebaut31-Mar-08 23:56 
GeneralRe: RAM usage Pin
Ali Rashid1-Apr-08 23:28
Ali Rashid1-Apr-08 23:28 
GeneralRe: RAM usage Pin
SimulationofSai2-Apr-08 1:23
SimulationofSai2-Apr-08 1:23 
GeneralMS Acess SQL Query using VS Query Builder and Variable Field Names Pin
Christian Yeates31-Mar-08 21:33
Christian Yeates31-Mar-08 21:33 
Questionhow to save only time in database field Pin
findtango31-Mar-08 19:10
findtango31-Mar-08 19:10 
GeneralRe: how to save only time in database field Pin
pmarfleet31-Mar-08 19:45
pmarfleet31-Mar-08 19:45 
GeneralRe: how to save only time in database field Pin
Ali Rashid31-Mar-08 23:52
Ali Rashid31-Mar-08 23:52 
QuestionCombobox's selected column must fill the Gridview Pin
Tristania Dementium31-Mar-08 2:38
Tristania Dementium31-Mar-08 2:38 
Generalselect and group by problem Pin
Xmen Real 31-Mar-08 1:13
professional Xmen Real 31-Mar-08 1:13 
GeneralRe: select and group by problem Pin
Rob Philpott31-Mar-08 1:20
Rob Philpott31-Mar-08 1:20 
GeneralRe: select and group by problem Pin
Xmen Real 31-Mar-08 1:22
professional Xmen Real 31-Mar-08 1:22 
GeneralRe: select and group by problem Pin
Rob Philpott31-Mar-08 1:26
Rob Philpott31-Mar-08 1:26 
Cool.

There may be a better way to do this, but here's what I'd do. In the old world you could create a view to represent each query and then join them together, but you can use Common Table Expressions in 2005 (http://msdn2.microsoft.com/en-us/library/ms190766.aspx[^]) which are similar.

So, create the two queries as you have them with the with keyword. Then to combine the two results set you want a full outer join with an isnull to check for null ids resulting from the join and to set nulls to zeros on the count.

Does that make sense?

Regards,
Rob Philpott.

GeneralRe: select and group by problem Pin
Xmen Real 31-Mar-08 1:30
professional Xmen Real 31-Mar-08 1:30 
Questioncurrent date query Pin
Pankaj Garg30-Mar-08 19:41
Pankaj Garg30-Mar-08 19:41 
GeneralRe: current date query Pin
Andy_L_J30-Mar-08 20:14
Andy_L_J30-Mar-08 20:14 
QuestionRe: current date query Pin
Pankaj Garg30-Mar-08 20:36
Pankaj Garg30-Mar-08 20:36 
GeneralRe: current date query Pin
Andy_L_J30-Mar-08 21:43
Andy_L_J30-Mar-08 21:43 

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.