Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
MrLeche

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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...