Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sudha12345
Starting Member
47 Posts |
Posted - 2009-04-28 : 04:21:18
|
| i has a table wih column a which has rows665814i want to insert unique data into another table wih column blike65814 without using Distinct key wordSudhakar |
|
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-04-28 : 04:23:48
|
| insert into tableb (id) select id from (select row_number()over(partition by id order by id) as rid, idfrom tablea) s where rid =1 |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-04-28 : 04:31:02
|
quote: without using Distinct key word
Hmmm . . . Smell like homework. What wrong with using DISTINCT ? Can you use GROUP BY ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|