Hello,I'm really very new to SQL (using MYSQL) and am trying to learn as much as I can as quickly as I can. I am working on a project that perhaps was a bit premature for my knowledge level of SQL, but that's my typical MO, jump in a work my way out. So here's my trouble. To keep it simple I have an Orders, Orders_Status, and Supers table. The relationship is this, for each individual "order" the Orders table will contain a key to a single record in the Order_Status table. The Orders table will also contain a key to a relevant record in the Supers table. Example[Tables] - Snip of fieldsOrders: OrderID (AutoInc/Unique Key) OrderStatusID SuperID InvoiceNumber LotNo ShipToAddr Open (TinyINT(1))Orders_Status: OrderStatus ID (AutoInc/Unique Key) Field1 Field2 Etc....Supers: SuperID (AutoInc/Unique Key) Supers_NameWhat I want to do is print a report on all the Orders that are open with the Order_Status info and also filter on SuperIDReport:SuperID=2SuperName=TonyOrders For Super = Tony-------------------------------------InvoiceNo, LotNo, ShipToAddr, Field1, Field2, Etc...Here's what I have so far.
SELECT o.InvoiceNumber, os.* FROM orders AS o, orders_status as os WHERE o.superid=2 and o.openclosed = 0;
I'm getting 70 records returned. There are only 14 records in the Orders table, 14 records on the Orders_Status table (1 record for each order), and 2 records in the Supers table. If I haven't provided enough info, more on request. Thank you all in advance for any help you may be able to give me.MySQL v4.1.11Server Debian Sarge 3.1MySQL Query Browser 1.1.19Windows XP SP2