|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Tricky Problem
Hi friends,
I have one doubt Just see. We have one table TAB1 A B C 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 ok? Now if we want to delete some record without using Procedures so that final data in the table will be A B C 1 1 1 2 2 2 we have to delete that data just see if anybody can find out the logic. Bye |
|
#2
|
|||
|
|||
|
I'm missing the point of this problem....
Why not use a procedure?
Can you use a temporary table? If so just run the following commands: select distinct a,b,c into #temp from tab1 delete from tab1 insert into tab1 select * from #temp drop table #temp If you may add an identity column to tab1 you could use one statement: delete from tab1 where row_id not in (select min(row_id) from tab1 group by a,b,c) |
|
#3
|
|||
|
|||
|
If you look for a mathematic approach search for topics related to linear algebra used for computer science.
|
|
#4
|
||||
|
||||
|
surely this is a simple case of using a select distinct, job done.
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Tricky Problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|