>Hi ,
> Sorry for asking stupid question again ~_~
> I wanna group some data :
> 1 : 000001
> 2 : 000001
> 3 : 000003
> 4 : 000004
> 5 : 000003
>
> and get a result like that :
> 1 : 000001
> 2 : 000003
> 3 : 000004
>
>Yeah ,as you know ,remove the data if there is already exist
>I wanna use for-loop and array to do that ,but it is zero efficiency ,I think .
>
>Any idea ?
>
You can USE SELECT DISTINCT... or a GROUP BY clause in a SQL Select statement to get the unique values:
If you have a table INVLINES (INVNO, INVAMT), you could:
SELECT DISTINCT INVNO FROM INVLINES TO CURSOR UNIQINVS
to just get the unique InvNo values, or
SELECT INVNO, SUM(INVAMT) AS INVAMTTOT FROM INVLINES GROUP BY INVNO
to get the unique InvNo along with the sum of theInvAmts from the matching records.
>Thanx for help ~ ^^