select bg.name, bg.uniqueId, cdr.cdr_recordId from tbl_CDR_Distributors cdr inner join tbl_BYG_BuyingGroups bg on cdr.fslBuyingGroupId = bg.uniqueId where cdr.ownerId = and cdr.fsl_tablecode = and cdr.cdr_dstcompanyType = 'G' order by bg.name select FSL_dstid, cdr.cdr_dstname from tbl_CDR_Distributors cdr where cdr.OwnerID = and cdr.FSL_TableCode = and cdr.cdr_dstcompanytype = 'P' order by cdr.cdr_dstname select shortdesc, ProdID, product from tbl_PRD_Products where OwnerID = and FSL_TableCode = and crmactive = 'y' and exists (select skuid from tbl_prd_skus where prodid = tbl_PRD_Products.prodid and crmActive = 'Y' and inactive = 0 ) order by shortdesc select category, categoryid from tbl_PRD_Categories where OwnerID = and FSL_TableCode = and exists (select skuid from tbl_prd_skus sku inner join tbl_prd_products prd on prd.prodid = sku.prodid and prd.categoryid = tbl_PRD_Categories.categoryid where sku.crmActive = 'Y' and sku.inactive = 0 ) order by category
    --->
    select distinct cdr_dstcompanytype from tbl_cdr_distributors where ownerid = and fsl_tablecode =
    select distinct cdr_dstcountryid from tbl_cdr_distributors with (nolock) where ownerid = and fsl_tablecode = and cdr_dstcountryid in (5,27) and crmactive = 'y' select distinct cdr_dstcountryid from tbl_cdr_distributors with (nolock) where ownerid = and fsl_tablecode = and cdr_dstcountryid not in (5,27) and crmactive = 'y'
    checked> checked>