I have 2 tables and i am using join to get common records from those 2 tables. i have used the following query but my problem is i am getting the records doubled. The query is as follows
SELECT * FROM pos_metrics pm INNER JOIN pos_product_selling pps ON
pm.p_id=pps.p_id WHERE pm.p_id='0' AND pps.pos_buying_id='0' AND pm.type=1
pos_metrics table:

pos_product_selling table:

Output:

EDIT
When I tried to use GROUP BY and DISTINCT together I am not getting duplicates but the value from the second table is repeated. Any other solutions ?
Add a primary key in the
pos_metricstable and introduce it to thepos_product_sellingtable, then do aJOINbased on the primary key as well as the other criteria. You won’t get these duplicates then.The reason you have duplicates over here is because there is no possibility of an unique comparison to be done on both tables based on a value.