I have this table. Some of the rows have duplicate values in the Kanji column.
How can I show these rows where the same Kanji appears more than once?
CREATE TABLE [dbo].[Phrase] (
[PhraseId] UNIQUEIDENTIFIER DEFAULT (newid()) NOT NULL,
[English] NVARCHAR (250) NOT NULL,
[Kanji] NVARCHAR (250) NULL,
PRIMARY KEY CLUSTERED ([PhraseId] ASC) );
You can use a GROUP BY
statement by that column and specify a constraint that COUNT(*)
of that group is larger than 1, so:
SELECT [kanji]
FROM [dbo].[Phrase]
GROUP BY [kanji]
HAVING COUNT(*) > 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With