Created
January 7, 2015 11:17
-
-
Save imvision/20584e2e9054c35a9721 to your computer and use it in GitHub Desktop.
T-SQL Get duplicate entries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with x as (select *,rn = row_number() | |
over(PARTITION BY [VoucherID] | |
,[MTransRecord] | |
,[ControlID] | |
,[ClientID] | |
,[SetteldDate] | |
,[Debit] | |
,[Credit] | |
,[Amount] | |
,[Naration] | |
,[SelectionsName] | |
,[BFCommissionRate] | |
,[Post] | |
,[MarketID] | |
,[SelectionID] | |
,[BetID] | |
,[PlacedDate] | |
,[AvgOdds] | |
,[ComissionRate] | |
,[Stake] | |
,[Status] | |
,[BetType] | |
,[TransactionID] | |
,[BFTrans] | |
,[ExchangeNo] | |
,[EventID] | |
,[ExchangeID] | |
,[EventTypeID] | |
,[LCShare] | |
,[archive] | |
,[CurrencyBuyRate] | |
,[CurrencySaleRate] | |
,[IsComSharePosted] | |
,[IsSharePosted] order by ClientID) | |
from [BetProExch].[dbo].[Transactions]) | |
SELECT * FROM x | |
where rn > 1 AND ClientID NOT IN (1, 4, 9) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment