Skip to content
Advertisement

Is there any query to find duplicate records count corresponding to package_no column?

I have a table structure like this

I Need to count duplicate road code corresponding to the column package_no I expect one record from the above table with a duplicate package p1 and road count with 1

Advertisement

Answer

You have a consistency problem. In your initial description you say “duplicate road code corresponding to the column package_no”, however in response to @GordonLinoff yoe indicate you want “duplicate appearance of r1”. Yet “r1” corresponds to road_name. So which is it: road_Code or rode_name. Either way:

Just replace road_name by road_code is required.
The query returns count – 1 as per initial requirement “p1 and road count with 1”

But what would the result be if the following also existed:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement