Hi
I have 6 column data, of which I need to validate 3 columns to check if they are same in the subsequent rows having same ID, if Yes then the output should show it as one row only, if not display it as how it is.
Data-
ID...Name...Row...Exp...time...rowcount
1.....A......50....0.....17:00...1
1.....A......50....0.....17:01...2
2.....B......10....2.....17:02...1
2.....B......20....10....17:03...2
2.....B......20....10....17:04...3
output data:
ID...Name...Row...Exp...time...rowcount
1.....A......50....0.....17:00...1
2.....B......10....2.....17:02...1
2.....B......20....10.....17:03...2
In 1st line of output, since ID (not unique), name, row, and exp are same then I need to display only the first row where rowcount=1. (1.....A......50....0.....17:00...1)
In last 3 lines of output, since first two of last lines are not same (row and exp not same), then this line is displayed. (2.....B......10....2.....17:02...1)
But in last two lines of output, since ID , name, row, and exp are same then I need to display only the first row of these two rows where rowcount=2. (2.....B......20....10.....17:03...2)
I tried using a distinct query for the three columns, but because the time and rowcount were not distinct, it was returning all rows. Can someone help me here please.
I have 6 column data, of which I need to validate 3 columns to check if they are same in the subsequent rows having same ID, if Yes then the output should show it as one row only, if not display it as how it is.
Data-
ID...Name...Row...Exp...time...rowcount
1.....A......50....0.....17:00...1
1.....A......50....0.....17:01...2
2.....B......10....2.....17:02...1
2.....B......20....10....17:03...2
2.....B......20....10....17:04...3
output data:
ID...Name...Row...Exp...time...rowcount
1.....A......50....0.....17:00...1
2.....B......10....2.....17:02...1
2.....B......20....10.....17:03...2
In 1st line of output, since ID (not unique), name, row, and exp are same then I need to display only the first row where rowcount=1. (1.....A......50....0.....17:00...1)
In last 3 lines of output, since first two of last lines are not same (row and exp not same), then this line is displayed. (2.....B......10....2.....17:02...1)
But in last two lines of output, since ID , name, row, and exp are same then I need to display only the first row of these two rows where rowcount=2. (2.....B......20....10.....17:03...2)
I tried using a distinct query for the three columns, but because the time and rowcount were not distinct, it was returning all rows. Can someone help me here please.