Select catalog.id, (Select alias from catalog_category where catalog_category.id=catalog.cat limit 1) as catalias from catalog where num>0 and cost>0 and cat>0 limit 0,1000
Unknown column 'num' in 'where clause'