remove duplicate

User avatar
sal21
PlatinumLounger
Posts: 4370
Joined: 26 Apr 2010, 17:36

remove duplicate

Post by sal21 »

In attached sheet the structure of my Table1.
I need with a Sql (VB6 and ADO) to remove duplicate based PROGRESS.
How to?

Note:
in old the actually data in new wath i need.
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78629
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: remove duplicate

Post by HansV »

Would it be OK to create a new table?
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4370
Joined: 26 Apr 2010, 17:36

Re: remove duplicate

Post by sal21 »

HansV wrote:Would it be OK to create a new table?
If is necessary yes, sure!

note:
original Table is named SERVIZIO

User avatar
HansV
Administrator
Posts: 78629
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: remove duplicate

Post by HansV »

Try

SELECT Max(SERVIZIO.DATA_MAIL) AS DATA_MAIL, SERVIZIO.PROGRESS, Max(SERVIZIO.DRICEZ) AS DRICEZ, Max(SERVIZIO.HRICEZ) AS HRICEZ, Max(SERVIZIO.OI) AS OI, Max(SERVIZIO.NOM) AS NOM, Max(SERVIZIO.SOLL) AS SOLL, Max(SERVIZIO.N) AS N, Max(SERVIZIO.CASO) AS CASO INTO SERVIZIO2 FROM SERVIZIO GROUP BY SERVIZIO.PROGRESS

This will create a new table named SERVIZIO2.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4370
Joined: 26 Apr 2010, 17:36

Re: remove duplicate

Post by sal21 »

HansV wrote:Try

SELECT Max(SERVIZIO.DATA_MAIL) AS DATA_MAIL, SERVIZIO.PROGRESS, Max(SERVIZIO.DRICEZ) AS DRICEZ, Max(SERVIZIO.HRICEZ) AS HRICEZ, Max(SERVIZIO.OI) AS OI, Max(SERVIZIO.NOM) AS NOM, Max(SERVIZIO.SOLL) AS SOLL, Max(SERVIZIO.N) AS N, Max(SERVIZIO.CASO) AS CASO INTO SERVIZIO2 FROM SERVIZIO GROUP BY SERVIZIO.PROGRESS

This will create a new table named SERVIZIO2.
sorry for delay, work perfect!

note:
but wathch wath i see in body of email(for admin of longue)...(&#)

SELECT Max(SERVIZIO.DATA_MAIL) AS DATA_MAIL, SERVIZIO.PROGRESS, Max(SERVIZIO.DRICEZ) AS DRICEZ, Max(SERVIZIO.HRICEZ) AS HRICEZ, Max(SERVIZIO.OI) AS OI, Max(SERVIZIO.NOM) AS NOM, Max(SERVIZIO.SOLL) AS SOLL, Max(SERVIZIO.N) AS N, Max(SERVIZIO.CASO) AS CASO INTO SERVIZIO2 FROM SERVIZIO GROUP BY SERVIZIO.PROGRESS

User avatar
HansV
Administrator
Posts: 78629
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: remove duplicate

Post by HansV »

The email apparently converts the parentheses ( and ) to character codes. I don't think we can avoid that. So it's always best to visit the forum when you receive an e-mail notification.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4370
Joined: 26 Apr 2010, 17:36

Re: remove duplicate

Post by sal21 »

HansV wrote:The email apparently converts the parentheses ( and ) to character codes. I don't think we can avoid that. So it's always best to visit the forum when you receive an e-mail notification.
OK!