Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to re-write a query to work in Mysql 3.23

Status
Not open for further replies.

nicr

IS-IT--Management
Jan 27, 2005
3
GB
Hi there.

One of our developers is using the following query in PHP 4.1.10a:

SELECT user_surname s, user_firstname f, membership_type m, user_email e
FROM registered_users
WHERE membership_number is not null
AND user_surname like 'A%'
UNION
SELECT surname s, firstname f, membership_type m, email e
FROM members
WHERE surname like 'A%'
AND membership_number NOT IN
(SELECT membership_number FROM registered_users WHERE membership_number is not null)
ORDER BY s, f ;

The problem is that our live (production) server runs MySQL 3.23.58 and this query doesn't work. Can anyone help me re-write the query in to a compatible version for 3.23.58? After reading the manual page, it appears that UNION queries aren't supported in < 4.0 but I'm not sure how to achieve the same functionality. Please help me :)

Nic
 
You can use a Temp table as illustrated in the second user comment at the bottom of
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top