find fg without category
user_0223141589
mysql
2 years ago
414 B
3
Indexable
Never
SELECT mp.NAME mo_ref, mp.CREATE_DATE, pt.DEFAULT_CODE part_num, pt.NAME part_name, mp.X_QTY_BUILT qty_built --mp.STATE FROM BIZ.DBT_STG.STG_ODOO_PROD__MRP_PRODUCTION mp JOIN BIZ.DBT_STG.STG_ODOO_PROD__PRODUCT_PRODUCT pp ON pp.id = mp.PRODUCT_ID JOIN BIZ.DBT_STG.STG_ODOO_PROD__PRODUCT_TEMPLATE pt ON pt.id = pp.PRODUCT_TMPL_ID WHERE pt.CATEG_ID in (1,9) and mp.STATE = 'done' ORDER BY 2 DESC