|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Duplicate rowhi all,
IF i had one table. in that table three records are there.all there have same datas.there is no primary key.how i can delete the second row in that table regards bala Hi,
How can u say which is the second row? U want to delete duplicate and want only one row? Reply -- Show quoteHerbert "balakarthik" wrote: > hi all, > > IF i had one table. in that table three records are there.all there have > same datas.there is no primary key.how i can delete the second row in that > table > > regards > bala hello there
try this use northwind select p.supplierid, p.unitprice,p.productid from products p join ( select supplierid, min(unitprice)as unitprice from products group by supplierid ) as p2 on p.supplierid=p2.supplierid and p.unitprice=p2.unitprice hope it helps -- Show quotethanks, ------------------------------------ Jose de Jesus Jr. Mcp,Mcdba Data Architect Sykes Asia (Manila philippines) MCP #2324787 "balakarthik" wrote: > hi all, > > IF i had one table. in that table three records are there.all there have > same datas.there is no primary key.how i can delete the second row in that > table > > regards > bala sorry wrong post
-- Show quotethanks, ------------------------------------ Jose de Jesus Jr. Mcp,Mcdba Data Architect Sykes Asia (Manila philippines) MCP #2324787 "balakarthik" wrote: > hi all, > > IF i had one table. in that table three records are there.all there have > same datas.there is no primary key.how i can delete the second row in that > table > > regards > bala bala
what do you mean by second row? rows not stored in an order in RDBMS. CELKO is not going to leave you !!!!! post ddl/sample data. Regards R.D Show quote "Jose G. de Jesus Jr MCP, MCDBA" wrote: > sorry wrong post > -- > thanks, > > ------------------------------------ > Jose de Jesus Jr. Mcp,Mcdba > Data Architect > Sykes Asia (Manila philippines) > MCP #2324787 > > > "balakarthik" wrote: > > > hi all, > > > > IF i had one table. in that table three records are there.all there have > > same datas.there is no primary key.how i can delete the second row in that > > table > > > > regards > > bala You've haven't seen the rath of Hurricane Celko!
Show quote "balakarthik" <balakart***@discussions.microsoft.com> wrote in message news:F742D9A8-CAC8-4501-B4C3-1374E68FCD83@microsoft.com... > hi all, > > IF i had one table. in that table three records are there.all there have > same datas.there is no primary key.how i can delete the second row in that > table > > regards > bala
Show quote
>> You've haven't seen the wrath of Hurricane Celko! <<
LOL!! the best way is to create the table again - correctly [with primary key]
- and insert the distinct values into it from the old table. The new table will of course have to have a different name. balakarthik wrote: Show quote >hi all, > >IF i had one table. in that table three records are there.all there have >same datas.there is no primary key.how i can delete the second row in that >table > >regards >bala > > |
|||||||||||||||||||||||