Jump to content


Photo

SQL Joins


  • Please log in to reply
1 reply to this topic

#1 Crimpage

Crimpage
  • Members
  • PipPipPip
  • Advanced Member
  • 70 posts
  • LocationBrisbane, Australia

Posted 19 May 2006 - 10:57 AM

Hi All,

Anyways... I have to try and fix a MS Access report my boss actually PAID someone to do, and it runs like crap.

We have an Active table, and an Archive table, to make access to the data in the active table quicker.

When running reports tho, we need to add the results of the Active table to the results from the Archive table.

They have one query running on the active, and the same one running on the Archive table. It then uses a MS Access thing called a UNION SELECT, which pretty much just puts the results on top of each other to make 1 recordset.

Is there a type of join that can do this? UPPER JOIN sounds like a good name for one... thats what I would call it if I made it...

By the way, I'm not using PHP for (Although I would like to...)

Cheers,

David.

#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 19 May 2006 - 11:24 AM

In a word, No.

JOINS take data from related records and aggregate the related columns of data in to single row.

In this case, UNION is the way to do it.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users