Click here to Skip to main content
15,909,091 members
Home / Discussions / Database
   

Database

 
QuestionSSIS re-validation of metadata Pin
Mel Padden17-Mar-11 5:46
Mel Padden17-Mar-11 5:46 
QuestionCross-Tabulations with multiple tables Pin
CodingLover16-Mar-11 22:53
CodingLover16-Mar-11 22:53 
AnswerRe: Cross-Tabulations with multiple tables Pin
Mycroft Holmes17-Mar-11 1:41
professionalMycroft Holmes17-Mar-11 1:41 
GeneralRe: Cross-Tabulations with multiple tables Pin
CodingLover21-Mar-11 2:20
CodingLover21-Mar-11 2:20 
GeneralRe: Cross-Tabulations with multiple tables Pin
Mycroft Holmes21-Mar-11 3:39
professionalMycroft Holmes21-Mar-11 3:39 
AnswerRe: Cross-Tabulations with multiple tables Pin
Chris Meech17-Mar-11 3:19
Chris Meech17-Mar-11 3:19 
GeneralRe: Cross-Tabulations with multiple tables Pin
CodingLover21-Mar-11 2:21
CodingLover21-Mar-11 2:21 
Questionmysql select from multiple tables / databases Pin
piticcotoc15-Mar-11 21:23
piticcotoc15-Mar-11 21:23 
Hy. I'm trying to do a select from multiple databases and tables for an occurence.

let's say i have databases db1, db2 and db3. Each have the following tables t1, t2, t3. And in each table there is a field named id which i want to select and a field and p_id which i want to use as a condition. To give a better idea this is an example of what results i want to get:

---------------------------------------
|id_t1 | id_t2 | id_t3 | database_name|
---------------------------------------
| 100  | 123   | 356   | db1          |
| 252  | 156   | 566   | db2          |
|...   | ...   | ...   | db3          |
---------------------------------------


How can i pass the p_id condition to each table and each database. I tried this:
select t1.id as id_t1, t2.id as id_t2, t3.id as id_t3, (select database()) as database_name from db1.t1, db1.t2, db1.t3 where ****can't make the condition work because if i only say p_id = 100 it says it's ambiguous****
union select *** all the above *** from db2 and db3

Thanks
AnswerRe: mysql select from multiple tables / databases Pin
Mycroft Holmes16-Mar-11 1:10
professionalMycroft Holmes16-Mar-11 1:10 
GeneralRe: mysql select from multiple tables / databases Pin
piticcotoc16-Mar-11 2:44
piticcotoc16-Mar-11 2:44 
AnswerRe: mysql select from multiple tables / databases Pin
jschell16-Mar-11 8:38
jschell16-Mar-11 8:38 
GeneralRe: mysql select from multiple tables / databases Pin
piticcotoc16-Mar-11 20:22
piticcotoc16-Mar-11 20:22 
QuestionDatabase Directory Pin
gmhanna15-Mar-11 17:23
gmhanna15-Mar-11 17:23 
AnswerRe: Database Directory Pin
Mycroft Holmes15-Mar-11 19:23
professionalMycroft Holmes15-Mar-11 19:23 
GeneralRe: Database Directory Pin
Roger Wright15-Mar-11 19:45
professionalRoger Wright15-Mar-11 19:45 
GeneralRe: Database Directory Pin
Mycroft Holmes15-Mar-11 20:03
professionalMycroft Holmes15-Mar-11 20:03 
GeneralRe: Database Directory Pin
Roger Wright15-Mar-11 20:30
professionalRoger Wright15-Mar-11 20:30 
GeneralRe: Database Directory Pin
Jörgen Andersson15-Mar-11 20:45
professionalJörgen Andersson15-Mar-11 20:45 
AnswerRe: Database Directory Pin
Wendelius15-Mar-11 19:51
mentorWendelius15-Mar-11 19:51 
AnswerRe: Database Directory Pin
PIEBALDconsult16-Mar-11 3:02
mvePIEBALDconsult16-Mar-11 3:02 
Questionhow to make server & clients? Pin
Nabawoka15-Mar-11 7:52
Nabawoka15-Mar-11 7:52 
AnswerRe: how to make server & clients? Pin
Wendelius15-Mar-11 8:38
mentorWendelius15-Mar-11 8:38 
AnswerRe: how to make server & clients? Pin
Corporal Agarn15-Mar-11 8:59
professionalCorporal Agarn15-Mar-11 8:59 
QuestionProduct of Salary Pin
Anubhava Dimri15-Mar-11 0:14
Anubhava Dimri15-Mar-11 0:14 
AnswerRe: Product of Salary Pin
Simon_Whale15-Mar-11 0:28
Simon_Whale15-Mar-11 0:28 

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.