I have a table, which i am creating a method on, i want run on action based on duplicatie values from 2 fields.
For example:
I have Table A which contains these fields:
IncidentDescription
Identifier
Now i want to run a certain action in the method based on the following criteria:
If the IncidentDescription already exists in another row in the same table, but only if the Identifier is different. (So it doesn't run the action if only 1 line with the IncidentDescription exists)
How can i solve this? Is it possible to accomplish this in an if statement?
Or is there a possibility/is it better to run a "while select" query, and (if it exists) run a count method based on the count result (>1).
EDIT:
I am trying to create the query as following:
select count (IncidentDescription) from TableA;
{
// I am trying to convert the result, because it gives me the error: "Operand types are not compatible with the operator, i am not sure how to make this.
serialCount = str2num(IncidentDescription);
if (IncidentDescription > 1)
//Action to go here;
}
I will build in the Identifier later.