Jump to content

Recommended Posts

Hi all!

 

I have two different tables, with no common fields, to be queried in one query and have the query return one resultset. The reason for this is I am working on a web app that displays listings of files from both tables. I don't want to have two separate queries because then the data from one table will be given precedent over data from another table (I think).. I also don't want to have to use a CRON job to populate a separate table every hour, as these records get updated frequently.

 

So, I am hoping there's a way to query two tables with no common fields to generate a single result set that I can then display to the end user.  The version of MySQL I have for now is 3.23, although the new webserver we're installing has latest MySQL 5.

 

Thank you very much in advance for any assistance!

Looks like UNION is the way I need to go, but MySQL 3.xx doesn't support it, as we're not using our PHP/MySQL5 server yet. I found this link as a work-around:  www.codewalkers.com/c/a/Database-Articles/Writing-UNION-statements-in-MySQL-3x/ but I can't seem figure out where I put in my conditionals for which rows I want to extract from each table...

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.