Click here to Skip to main content
15,887,485 members
Home / Discussions / Database
   

Database

 
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 
GeneralRe: current date query Pin
Ashfield30-Mar-08 21:17
Ashfield30-Mar-08 21:17 
GeneralRe: current date query Pin
Pankaj Garg30-Mar-08 21:27
Pankaj Garg30-Mar-08 21:27 
GeneralRe: current date query Pin
Ashfield30-Mar-08 23:20
Ashfield30-Mar-08 23:20 
GeneralRe: current date query Pin
Sankar Komma 2-Apr-08 11:10
Sankar Komma 2-Apr-08 11:10 
GeneralORA-12528: TNS:listener: all appropriate instances are blocking new connections how could i solve this probelm Pin
lakshmichawala30-Mar-08 19:17
lakshmichawala30-Mar-08 19:17 
QuestionRestoring database file problem Pin
hari4ur30-Mar-08 18:57
hari4ur30-Mar-08 18:57 
GeneralRe: Restoring database file problem Pin
A Wong31-Mar-08 4:58
A Wong31-Mar-08 4:58 
GeneralRe: Restoring database file problem Pin
hari4ur31-Mar-08 5:46
hari4ur31-Mar-08 5:46 
Generaldata bace problem Pin
asha_s30-Mar-08 7:45
asha_s30-Mar-08 7:45 
Generaldatatable expression column Pin
saltcode29-Mar-08 11:19
professionalsaltcode29-Mar-08 11:19 
GeneralRe: datatable expression column Pin
Xmen Real 31-Mar-08 1:26
professional Xmen Real 31-Mar-08 1:26 
Questionhow to solve this erro plz Pin
lakshmichawala29-Mar-08 2:38
lakshmichawala29-Mar-08 2:38 

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.