SELECT p.seolink, l.categoryid FROM ecom_products p INNER JOIN ecom_productcategorylinks l ON l.productid = p.id INNER JOIN ecom_categories c ON l.categoryid = c.id WHERE p.id = 194 AND p.moduleid = 1 AND l.moduleid = 1 AND p.status = 1 AND l.status = 1 AND c.status = 1 AND l.default_category = 1