hi there,
i'm totally noob to mysql inner joins, but i need to know how do i select all the fields/columns and records in table a where a.someid = number1 AND a.anotherid = number2, and all the fields/columns where the records in table b match on a.thirdid = b.thirdid and a.anotherid = b.anotherid. i'm battling to discover which type of join i should use firstly, it seems a left join would work but no results are returned despite records being available in the respective tables.
here is the PMA response and the sql query i am trying to process in pma's sql editor for the database, i'm not really surprised as i am not at all sure which joins do what. i need all the columns in the returned result to have values, from this data it should be 2 records in the resultset.
Quote:
MySQL returned an empty result set (i.e. zero rows). ( Query took 0.0004 sec )
|
Code:
SELECT *
FROM 9_supplierattributes
LEFT JOIN 3_serviceattributes ON (3_serviceattributes.bigint_AttributeID = 9_supplierattributes.bigint_AttributeID
AND 3_serviceattributes.bigint_AttributeServiceID = 9_supplierattributes.bigint_ServiceID)
WHERE 9_supplierattributes.bigint_SupplierID = 1
AND 3_serviceattributes.bigint_AttributeServiceID = 1
the available records for these tables are:
Code:
9_supplierattributes
bigint_SupplierID | bigint_ServiceID | bigint_AttributeID | bigint_RegionID
6 1 1 7
6 1 2 7
Code:
3_serviceattributes
bigint_AttributeID | text_AttributeDescription | text_AttributeValue | bigint_AttributeServiceID
1 Test Attribute 1 Test Value 1 1
2 Test Attribute 1 Test Value 2 1
11 Test Attribute 1 Test Value 3 1
12 Test Attribute 2 Test Value 1 1
13 Test Attribute 2 Test Value 2 1
any help or even a nudge in the right direction will be greatly appreciated. :)
__________________
Sincerely,
Pierre "Greywacke" du Toit
pierre@greywacke.co.za
don't worry about my 0 thankyou's either way, i would say thank you should you help, and i will gladly help others when this work rush is over.