>Hi all,
>
>I have a table named company. as i forget to set primary key in the table
>i find the table have records like this:
>co_id co_ref1 co_ref2 co_ref3
>c1 peter john
>c1 john mary
>
>Now i want to set the co_id as primary key but the key fields have records
>with same key value. I want to write a sql to combine the above 2 records as:
>
>c1 peter john mary
>
>I have tried some sql statement but cannot do it. Can someone please tell
>me how? thx.
>
>Linda
Linda,
You should use HTML tags < PRE > and < /PRE > (without the spaces) to keep allingment.
To combine records, you would usually use SELECT ... GROUP BY; however, I see no way of doing this with a single SELECT command.
You can, however, call a UDF() from the GROUP BY clause. You can also use a traditional SCAN to loop through all the records.
HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)