co_id co_ref c1 peter c1 john c1 maryThe following select will convert your data and remove duplicates
Select co_id, co_ref1 AS co_ref ; From mytable ; Where co_ref1 <> SPACE(1) ; Union ; Select co_id, co_ref2 AS co_ref ; From mytable ; Where co_ref2 <> SPACE(1) ; Union ; Select co_id, co_ref3 AS co_ref ; From mytable ; Where co_ref3 <> SPACE(1) ; Order By 1,2 ; Into Cursor crsTemp1>Hi all,
>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
>c1 peter john mary>I have tried some sql statement but cannot do it. Can someone please tell