SQL query (can include pl/sql bits) based on conditional count <p>Premise: We've got a table with 5 fields. 2 fields are always unique. </p> <p>What would be a good way to fulfill this: </p> <p>if (count_of_result == 3) { add up the 3 rows from the same table. unique values get added up &amp; the non-unique values are assumed to be same for all the 3 rows. the query result should show 1 row, with the values added up. } else { </p> <p>display all the results of the query as usual.</p> <p>}</p> <p>Thank you.</p>