'i want remove row has one value duplicated with other row (resultSet)
i want to remove rows has duplicate value in specific column
my Query return data like this:
| Column1 | Column2 | Column3 | Column4 |
|---|---|---|---|
| 1 | text1 | First | exp1 |
| 2 | text2 | Second | exp2 |
| 3 | text3 | third | exp3 |
| 4 | text4 | third | exp4 |
I want it like this:
| Column1 | Column1 | Column1 | Column1 |
|---|---|---|---|
| 1 | text1 | First | exp1 |
| 2 | text2 | Second | exp2 |
| 3 | text3 | third | exp3 |
MY QUERY VALUE DUPLICATE IS t2.numeroLot
select t2.nomClient,t2.numeroTlf,t2.numeroLot,t2.nature,t2.prixPaiement,t1.paym,t1.payer from ((select dossier.refDossier, (Paiement.prixPaiement SUM(CONVERT(float,PaiementDeclare.montant))) as paym,SUM(CONVERT(float,PaiementDeclare.montant)) as payer from payment
left join dossier on dossier.idPaiement = payment.idPaiement left join PaiementDeclare on PaiementDeclare.idPaiement = Paiement.idPaiement group by Paiement.prixPaiement,dossier.refDossier)
left join (select dossier.refDossier,client.nomClient,client.numeroTlf,lot.numeroLot,lot.nature, Paiement.prixPaiement from dossier
left Join dossierClient on dossierClient.idDossier = dossier.idDossier
left join client on client.idClient = dossierClient.idClient
left join dossierLot on dossierLot.idDossier = dossier.idDossier
left join lot on lot.idLot = dossierLot.idLot
left join Paiement on Paiement.idPaiement = dossier.idPaiement
left join PaiementDeclare on PaiementDeclare.idPaiement = Paiement.idPaiement
group by prixPaiement,dossier.refDossier,client.nomClient,numeroTlf,lot.numeroLot,lot.nature) t2
on t2.refDossier = t1.refDossier)
where t1.refDossier is not null```
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
