• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 222
  • Last Modified:

select * from 3 tables

select * from table1,table2,table3  doesnt work

and want to order by table1.id
0
rgb192
Asked:
rgb192
2 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
how these table are related ?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
can you clarify how the output should look like?
1 table behind the other, or side-wise.
please show data samples.
0
 
leakim971PluritechnicianCommented:
Hello rgb192,

Don't work ? You don't have the expected result(s) ?
Do you know the primary key and/or foreign key of the tables ?

Regards.


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
SharathData EngineerCommented:
Please answer all the open questions from others. Did you try like this?

select *
 from table1
cross join table2
cross join table3
order by order by table1.id
0
 
Chris MConsulting - Technology ServicesCommented:
If you want to query all three tables and these tables have identical structures, then run the following statement:

select * from table1
union select * from table2
union select * from table3
order by id;

The way your query sounds, it's like you want to pick related data from these three tables.
Then the previous answer from Sharath should be fine.
0
 
rgb192Author Commented:
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now