Q:

Multiple Selects in Single Query

I'm hoping someone fluent in MySQL will be able to assist me with this. I'm trying to do a select on a select on a select, but the query doesn't seem to want to complete. Any help would be greatly appreciated.
SELECT 
    product as pid, 
    leg_name as name, 
    dimensions as dims 
FROM 
    pmaint 
WHERE 
    product in (
        SELECT product 
        FROM qb_export_items_attributes
        WHERE attribute_name = 'Z' 
        AND product in (
                SELECT product
                FROM pmainT
                WHERE type_ID = (
                        SELECT ID
                        FROM type
                        WHERE SOFTCARTCATEGORY = 'End Table Legs'
                    )
                )
        AND attribute_value <= 3.5
    )

A:

Try to use INNER JOINs instead of IN subqueries
UPD: I've edited this query according you comment. the first JOIN subquery output all product where both attributes exists and true.
SELECT 
    pmaint.product as pid, 
    pmaint.leg_name as name, 
    pmaint.dimensions as dims 
FROM 
    pmaint 
JOIN (select product from qb_export_items_attributes
       where ((attribute_name = 'Z') and (attribute_value <= 3.5))
             OR
             ((attribute_name = 'top_square') and (attribute_value >= 4))
       GROUP BY product HAVING COUNT(*)=2
      ) 

         t1 on (pmaint.product=t1.product )
JOIN type on (pmaint.type_ID=type.ID)
WHERE 
        type.SOFTCARTCATEGORY = 'End Table Legs'

