var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: sql problem
Is there an easy way using sql to find all records in a table where the value in the same field is identical and to update the record at the same time?
For example I have a table which has 2 fields:
Table = invoice
Fields = Description & Cost
The values in the description fields may be identical - if they are then I want to modify the description with the highest cost.
If those are the only two fields in the table, why would you want to change two of the records to be identicle?
Also, what do you mean by "modify the description with the highest cost". If you have three records with the same description and different costs, which one gets augmented and with what information?
If you want a list of the highest costs for a given description, you could use something like:
SELECT description, MAX(cost)
GROUP BY description
I want to modify the description field of one of the identical records so it becomes different from the other.
If 3 records are the same then only the record with the highest value will be modified.
Still don't get it. Please post an example dataset before and after alteration.
Maybe you could use the "find duplicates" query wizard to get what you're looking for?