You could do this:
users admins
----- ------
userID userID
fname
lname
select U.* from users U, admins A where A.userID=U.userID && (U.userID=100 ||
U.userID=101)
you could also use the IN () function ...
select U.* from users U, admins A where A.userID=U.userID && U.userID
in (100,101,400,500)
Hope this helps!
--Joe
On Mon, Feb 05, 2001 at 11:34:21PM -0600, Dallas Kropka wrote:
>
>
> Is it possible to include an OR condition in a MySQL select on 2 different
> tables?
>
> I have 1 table of basic customers and one table of Admins, both tables
> "Relate" to the UserNum table containing UserNumber login password and
> privs, I want to select one field from the correct table based on the
> usernumber which is unique to all users and stored in the root User
> table.... trying to do something like this....
>
> SELECT first_name FROM admin_table, user_table WHERE userNum = 1000
>
> The info will only be in one or the other.... but what (if any) is the
> correct syntax?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
-------------------------------------------------------------------------------
Joe Stump, PHP Hacker, [EMAIL PROTECTED] -o)
http://www.miester.org http://www.care2.com /\\
"It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V
-------------------------------------------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]