hi
I want to fetch data from four tables using a single query.please tell me how to do that.
thanks in advance

hi
I want to fetch data from four tables using a single query.please tell me how to do that.
thanks in advance

try select * from a, b, c, d

then sort out at your leisure :D

select table1.*,table2.*,table3.*,table4.* from table1
inner join table2
  on table1.column1=table2.column1
inner join table3
  on table1.column1=table3.column1
inner join table4
  on table1.column1=table.column1

change table names and column names accordingly

put your create table syntax for all 4 tables
then some 1 can send a exact query

put your create table syntax for all 4 tables
then some 1 can send a exact query

Obviously a task too overcharging him. Why not letting him doing plain cross products first a la posting #2 ?

select * from a, b, c, d
this will produce a Cartesian output

say you have 100 rows in each table
o/p will be 100 x 100 x 100 x 100

you know why it doesn't have how to join tables

correct, it is cartesian product, not cross product. thank you, varmadba :)

True, the cardinality is just the total product of the cardinalities of all involved tables. But this might be ok to him. So he would learn how to figure out the essential rows manually doing true handiwork.

did i write Cross product in my post,
if so my my...

how feasible it is to handwork output if you have trusted DB to do that

dont think so...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.