Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
54 views

Preventing duplicates when aggregating data from two many to many tables [duplicate]

A player will make a number of wagers...and may or may not win on any or all of them. Looking to aggregate the total count and amount of wins from WINNERS and find and aggregate matches from WAGERS. I ...
Zinzah's user avatar
  • 11
0 votes
0 answers
20 views

How to get the second row of each duplicate values only in SQL Server? [duplicate]

How to get the second row of each duplicate values ? id name email 1 John John-email **2 John John-email** 3 Mac mac-email **4 Mac mac-email** 5 Son son-email **6 Son son-email** **7 Son son-email** 8 ...
maulana44's user avatar
-1 votes
1 answer
122 views

Parsing First Name and Last Name

I am using SQL Server 2008 for this. I am trying to parse first name and last name separately from a column that contains a full name value. After parsing, I would like to store that value in a ...
Curious's user avatar
  • 11
-1 votes
1 answer
82 views

How to keep the 1st record of duplicate records [duplicate]

I know there are many questions over this and many solutions, most of them specific to each individual's case. However, in my case I cannot seem to get just the sets of records that are to be deleted, ...
Fandango68's user avatar
  • 4,917
0 votes
1 answer
62 views

How to create an UPDATE statement for merging duplicates across multiple tables?

I was wondering if anybody would be able to help me with this UPDATE statement I have around 300 or so customer records that includes data like addresses, inspection records, notes all across multiple ...
user21907898's user avatar
0 votes
3 answers
83 views

SQL Finding Duplicate Values

I am working on creating a query to find duplicates within a table. I have ID, customernumber and status columns. The Status column can be either ('open') or ('closed'). What I am trying to accomplish ...
GreyFox9881's user avatar
1 vote
3 answers
100 views

SQL compare 2 columns and find a duplicate value in 2nd Column with specific criteria

I have the following set up CREATE TABLE #TestEmailTable ( companyId INT, username VARCHAR(255), emailAddress VARCHAR(255) ) INSERT #TestEmailTable VALUES (570599,'[email protected]'...
Paul's user avatar
  • 1,235
0 votes
2 answers
74 views

Select Duplicates with distinct/DIFFERENT names

I have Articles base: INDEKS_KATALOGOWy ID_MAGAZYNU Nazwa Opa000001 1 Węgiel Opa000001 6 Węgiel Opa000001 7 Węgiel Opa000002 1 Węgiel brunatny Opa000002 6 Węgiel brunatny Opa000002 7 Węgiel brunatny ...
Tomasz Maciążek's user avatar
-3 votes
1 answer
83 views

Removing Dupes in joins [closed]

Nothing I've tried removes dupes from table 1 Here is a basic join of my tables SELECT t1.ORDERNUM, t1.TOTALAMT, t2.refrence, t2.DEBITAMT FROM table1 t1 JOIN table2 t2 ON t1....
Jack's Dad's user avatar
-2 votes
1 answer
58 views

Copy Sr number if email match

I am working on a query in SQL SERVER 2017. My table has 3 columns:Sr#,Email,Duplicate#. The end goal is to copy the serial number from Sr# column to Duplicate# if the email addresses repeat. For ...
zain ul abidin's user avatar
0 votes
1 answer
93 views

How to delete duplicate rows that have same data except one column [duplicate]

I am trying to delete duplicate rows but leaving recent updated rows. Here is illustration of my dataset: I am trying to delete two rows that are older data (in this case 11/19's - highlighted in ...
Java's user avatar
  • 1,304
-2 votes
1 answer
85 views

SQL Server Duplicate

I need to find duplicates in a table named lead, which contains around 100k records. The duplicates have similar values in the company column, such as: The goal is to retain only the latest leadid (...
upwork_abid's user avatar
-2 votes
1 answer
81 views

How to return duplicates

I have SQL Server. For example I have such query: select playerid, fullname from players where playerid in (123,123,1234,1234,1234) How I can make to return at result duplicates, I mean at this ...
Maria's user avatar
  • 13
-2 votes
3 answers
152 views

Delete all duplicate employee records excluding the most recent record for each employee [duplicate]

[Microsoft SQL Server 2019 (RTM-CU18) (KB5017593) - 15.0.4261.1 (X64)] I have this query to find all duplicate employee records. A duplicate record is a record with the same EmployeeID as another ...
Bushmatic's user avatar
0 votes
1 answer
40 views

Capture all queries running within a timeframe

My application is inserting duplicate records and I'm trying to figure out what causes that. It could be coming from the UI application, some stored proc or a nightly SQL job. I have looked into ...
Jay's user avatar
  • 339

15 30 50 per page
1
2 3 4 5
51