(SELECT c.categoryId as categoryId, s.subCategoryId as subCategoryId, c.categoryName as categoryName, s.subCategoryName as subCategoryName, c.status AS cStatus, s.status AS sStatus FROM categories AS c RIGHT JOIN subcategories AS s ON c.categoryId =s.categoryId)
ORDER BY categoryName, subCategoryName ASC