I am generating a table in postgresql with PHP.
Resulting table
There are a lot of rows with the same values with exception of the first column, this is the unique ID. When I am trying to remove based on similar values in gene_id, searchterm and type.
Therefore, I used the following code:
$sql = "SELECT DISTINCT gene_id FROM searchterms";
Or
$sql = "SELECT DISTINCT ON (gene_id,searchterm,types) * FROM searchterms";
After executing this code I still got the same result. I would like to keep only row with id 4.