mysql> select solution
    -> from os_table os, solutions_table solutions
    -> where os.os_id = solutions.os_code
    -> and os.os_id = 8;

-ms


-----Original Message-----
From: John Hoskins [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 02, 2003 10:41 AM
To: [EMAIL PROTECTED]
Subject: select help


Please consider the following two tables:

mysql> select * from os_table;
+-------+----------+
| os_id | os_name  |
+-------+----------+
|     1 | mac os   |
|     2 | win 95   |
|     4 | win 98   |
|     8 | win nt   |
|    16 | win 2000 |
|    32 | win me   |
|    64 | xp home  |
|   128 | xp pro   |
+-------+----------+

mysql> select * from solution_table;
+---------+---------------------+
| os_code | solution            |
+---------+---------------------+
|       1 | mac fix             |
|      24 | nt and 2000 dun fix |
|     255 | no-pay contact CSRs |
+---------+---------------------+


What I'd like to do is select all solutions that 
applys to  NT, os_id.os_table=8

so it should return solution 24 and 255. Since these two solutions have
the NT os bit turned on.

Thank You
John H.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to