Hi All! I think you've done a wrong job!
Try Simply Code:
Select * from act_plan ;
group by (sin + DTOC(add_date) + TTOC(add_time))) ;
into table tmpact_plan
OR
Select * from act_plan ;
group by sin, add_date, add_time ;
into table tmpact_plan
GROUP BY will only take the first occurence records and skip all next records.
Normal use on
Group By is to calculate some statistic information,
such as COUNT(*), SUM(), AVG()...
>^.^< Good luck!
>Hello:
>I'm trying to write a program to remove duplicate records from my
>database table. I need to remove the index first, scan for duplicates, delete all and then recall the first record of each duplicate and then add the regular index back. CAn I do this
>without having to resetting the relationships up in the database?
>
>THis is my rough code. Any help would be appreciated.
>
>close all
>set defa to \wincats\data
>
>use act_plan
>delete tag sincase of act_plan
>
>
>set order to sin
>go top
>dsin = sin
>dadddate = add_date
>daddtime = add_time
>
>Scan
> locate for sin = dsin, add_date = dadddate, add_time = daddtime
> Do while found()
> delete
> go top
> recall
> pack
>Endscan
>
>ALTER TABLE Act_plan ADD PRIMARY KEY Sin + Caseno TAG Sincase
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.