this is a query used on the downloads page which gets all subcats each download is realted to....
SELECT bpdc.*,bpc.bpc_name, bps.bps_name
FROM dbo.tbl_module_best_practice_downloads_categories bpdc
LEFT JOIN dbo.tbl_module_best_practice_categories bpc ON bpc.bpc_id = bpdc.bpdc_category_id
LEFT JOIN dbo.tbl_module_best_practice_subcategories bps ON bps.bps_id = bpdc.bpdc_subcategory_id
WHERE bpdc_deleted = 0
AND bpdc.bpdc_download_id =
ORDER BY bpc.bpc_rank, bps.bps_rank
This query gets all subcats...
select *
from tbl_module_best_practice_subcategories bps
left join tbl_admin_user AU on bps.bps_last_edited_by = AU.au_id
where bps.bps_id =
and bps.bps_deleted = 0;
where bps.bps_deleted = 0
order by bps.bps_rank;
I now need one which gets all downloads related to each subcat....
?
|