Running 4.0.18

I am trying to run a query where the query gets the offer_ID of a certain
customer from the offer table and displays in the results the offer_Name
associated with the offer_ID. Right now the way the query is working it
displays all the offers in the offer table regardless of the offer_ID
assigned to the customer. Any thoughts?


SELECT c.cst_SiteID,  c.cst_IDC, a.asset_ID,  o.offer_ID, o.offer_Name FROM
customers c, assets a , offers o WHERE c.cst_SiteID = a.asset_SiteID  AND
cst_Name LIKE 'z%'

Results:
| cst_SiteID | cst_IDC | asset_ID | offer_ID | offer_Name             |
+------------+---------+----------+----------+------------------------+
|       6916 |       2 |    18165 |        3 | Basic Monitoring       |
|       6916 |       2 |    18165 |        8 | Unknown                |
|       6916 |       2 |    18165 |        1 | Advanced Managed       |
|       6916 |       2 |    18165 |        5 | Mixed Managed          |
|       6916 |       2 |    18165 |        6 | No Monitoring          |
|       6916 |       2 |    18165 |        2 | Advanced Monitoring    |
|       6916 |       2 |    18165 |        4 | Internally Managed     |
|       6916 |       2 |    18165 |        7 | Performance Monitoring |
+------------+---------+----------+----------+------------------------+


customers Table
+--------+------------+------------------------------------------+---------+
-------------+---------+-----------+
| cst_ID | cst_SiteID | cst_Name                                 | cst_IDC |
cst_MgtType | cst_POC | cst_Offer |
+--------+------------+------------------------------------------+---------+
-------------+---------+-----------+
|   2418 |       897 | JTE (H.K.) Limited                       |       9 |
5 |       0 |         6 |
|   2417 |       799 | Zape Corporation                         |       7 |
5 |       0 |         6 |
|   2416 |       728 | Zone , Inc.                      |       9 |
5 |       0 |         6 |
|   2415 |       702 | ZL Batavia, LLC                          |      16 |
1 |       0 |         1 |
+--------+------------+------------------------------------------+---------+
-------------+---------+-----------+

offers Table
+----------+------------------------+---------------------------------------
------+
| offer_ID | offer_Name             | offer_Search
|
+----------+------------------------+---------------------------------------
------+
|        1 | Advanced Managed       | Advanced Managed
|
|        2 | Advanced Monitoring    | Advanced Monitoring
|
|        4 | Internally Managed     | Internally Managed
|
|        3 | Basic Monitoring       | Basic Monitoring
|
|        5 | Mixed Managed          | Mixed Managed
|
|        6 | No Monitoring          | No Monitoring
|
|        7 | Performance Monitoring | Performance Monitoring, Performance
Managed |
|        8 | Unknown                | Unknown
|
+----------+------------------------+---------------------------------------
------+

Sincerely,
Chris Dietzler
AT&T Enhanced Network Services
858 812 4062


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

Reply via email to