Jump to content
Larry Ullman's Book Forums

Selecting Multiple Unsimilar Tables


Recommended Posts

Hi,

 

I would like to know how you would select from multiple tables:

 

tableA

colx, coly, cola, colb, colc

 

and

 

tableB

col1, col2, cola, colb, colc

 

the tables only differ from the first 2 columns of each of them (tables) but I would like to have it SELECT * FROM "both of them"

 

actually the reason for that is I wanted to lay all out in a while() loop, and at the same time paginate it.

 

while tableA consist of older records, time-wise, it will be the first to be "echo-ed", I had problems paginating it if I do not join the query into a single query as opposed to querying tableA, then echo, then query tableB then echo.

 

 

thanks!

Link to comment
Share on other sites

SELECT *
FROM tableA, tableB
....

 

A tips thought; User more descriptive names for your tables and columns. :)

 

 

Sheez, that easy I was googling and resulted to JOINS, LEFT JOINS, ON AS... Thanks, I'll run a quickie.

Link to comment
Share on other sites

 Share

×
×
  • Create New...