suhaib1122 Posted June 26, 2015 Share Posted June 26, 2015 I have a table name tblnetworkstatus and I have 11 columns Id issue_name affected_server affected_service issue_type priority duration status start_date end_date description I am getting id in affected_server and affected_service which I am storing in my DB, now I have three situations Either both affected_server and affected_service has been selected Only affected_server is selected Only affected_service is selected I am getting the name of affected_server and affected_service from tblserver and tblproducts respectively using join on three tables tblnetworkstatus,tblserver and tblproduct I already have the following query got from here SELECT m.issue_name ,m.issue_type , m.priority ,m.status,m.description , m.start_date,m.end_date,m.duration, s.name as server_name,p.name as product_name from mod_networkstatus as m LEFT JOIN tblservers as s ON FIND_IN_SET(s.id,m.affected_server) LEFT JOIN tblproducts as p ON FIND_IN_SET(p.id,m.affected_service) But If I have multiple id's of affected_server and affected_service like I am storing 1,2,3,4 in a single column affected_server or affected_service and I am getting the record duplicate instead only the affected_server or affetced_service is different in that which I don't want I want to show these in a single coulmn field after retrieving like stroing 1,2,3,4 then how can I do that? Quote Link to comment https://forums.phpfreaks.com/topic/297038-showing-duplicate-records-in-mysql-query/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.