该程序运行正常。我需要的是对程序的结果进行行计数。
DROP PROCEDURE `tradematch`//
CREATE DEFINER=`root`@`localhost` PROCEDURE `tradematch`(IN `pid` INT)
BEGIN
SELECT p.company_name,p.company_info,pc.contact_address,pc.mobilenumber,p.idprofile,b.businesstype
FROM profile p,profile_contact pc,businesstypelkp b
WHERE p.idprofile=pc.idprofile_contact
AND p.business_type=b.idbusinessTypeLKP
AND p.idprofile not in (SELECT p.idprofile FROM profile p WHERE FIND_IN_SET(idprofile,(select Group_Concat(member_list) as group_members from groupmemberlkp where profile_id=pid))) AND FIND_IN_SET(idprofile,(SELECT group_concat(p.profileid) from products_profile p where FIND_IN_SET(product_id,(SELECT group_concat(product_id) FROM `rawmaterial_profile` WHERE profileid=pid))AND p.profileid!=pid));
END//