|
Author |
Message |
Hertzsprung
WebHelper
Joined: 30 Jul 2002
Posts: 56
Location: UK
|
Posted:
Wed Jul 31, 2002 12:30 pm (22 years, 4 months ago) |
|
Is there a way to concatenate two sets of results like this:
SELECT UserID, Name FROM Users WHERE Disabled = 0
+
SELECT UserID, Name FROM Users WHERE Disabled = 1 ORDER BY Name
Oh, and is the syntax for those queries correct or do I need "==" instead of "=" ? |
Last edited by Hertzsprung on Wed Jul 31, 2002 1:59 pm, edited 1 time in total |
|
|
|
Hertzsprung
WebHelper
Joined: 30 Jul 2002
Posts: 56
Location: UK
|
Posted:
Wed Jul 31, 2002 12:58 pm (22 years, 4 months ago) |
|
I have done some investigation to find that there is the UNION statement available in MySQL version 4.0.0 or higher. Would it be better to perform the union in PHP and assume MySQL version 3.x on web servers? |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Wed Jul 31, 2002 1:27 pm (22 years, 4 months ago) |
|
SELECT UserID, Name FROM Users WHERE Disabled = 0 OR Disabled = 1 ORDER BY Name
Wouldn't that give you a list of users where Disabled was 1 or 0. |
|
|
|
|
Hertzsprung
WebHelper
Joined: 30 Jul 2002
Posts: 56
Location: UK
|
Posted:
Wed Jul 31, 2002 1:59 pm (22 years, 4 months ago) |
|
Yes, but I don't want the ones that aren't disabled to be sorted |
|
|
|
|
Darren
Team Member
Joined: 05 Feb 2002
Posts: 549
Location: London
|
Posted:
Wed Jul 31, 2002 2:33 pm (22 years, 4 months ago) |
|
i thought that was too easy - I have no idea then |
|
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.129153 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |