I have a task at hand to identify negative values in a table and find a matching positive value in same table/column, then delete both entries. It is possible that there could be multiple positive values in the column and in such case only one of the matching positive values along with the negative value should be deleted. There will only be one negative value but could be multiple matching positive values. Values in this case are numerical (transaction data).
As an example, table 'Transactions' and column 'Value' has: -10.02, 10.02, 10.02
I require a sql query that will delete the negative value and one of the matching positive values.
I have tried using 'select abs' to convert negative to positive and then 'having count' but it only returns the 2 positive values. I am likely on the wrong track and have very basic SQL skills.
All help will be appreciated!