Home Forums SQL Server 2008 SQL Server Newbies How do I SELECT DISTINCT on a field into a new table while including all columns? RE: How do I SELECT DISTINCT on a field into a new table while including all columns?

  • I got it to work in SQL but I figured out that it's not a SQL issue this line works:

    select * Into NewTabe from( select *, row_number()over(partition by Code order by Code) As rn From database) t where rn = 1 order by Code

    This issue is I am trying to run this sql statement through vb.net, and vb.net does not support row number() or partition....