Jump to content

SELECT * FROM TWO TABLES


scrubbicus

Recommended Posts

Not only it's slow, it's totally senseless.

 

Probably you should use UNION

That only works if you're selecting the same number of columns from each table, which is not always the case.

Of course, but that's a formal point, and you can find a workaround to it.

But if your tables are not related, surely you can't join them. And this is a logic point, no workaround.

These two tables are not related to each other.

 

One is where all the articles are posted and the other is where I store all my content information for the different pages. I just want to be able to SELECT ALL from each table preferably a different column name for both but I can definitely change the column name so that the 'content' column is the same for both. So I'd be selecting two different tables with a column that has the same name.

Hi

 

It would join every row together. Ie, say one table had rows with a column values 1, 2 and 3, while the other had values 7, 8 and 9, you would get returned 9 rows rather than 6, each with 2 columns giving 1,7 / 1,8 / 1,9 / 2,7 / 2,8 / 2,9 / 3,7 / 3,8 / 3,9.

 

As the number of rows on the originals tables increased the number of returned rows would go through the roof.

 

It can be useful if you want every combination of rows between 2 tables, but almost certainly not in this situation.

 

All the best

 

Keith

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.