Seguendo (esattamente lo stesso) query come la tua fornisce i risultati che specifichi.
;WITH q AS (
SELECT ID = 1, Fname = 'John', Lname = 'Doe'
UNION ALL SELECT 2, 'Barry', 'Singer'
UNION ALL SELECT 3, 'John', 'Doe'
UNION ALL SELECT 4, 'James', 'Brown'
)
SELECT *
FROM q
WHERE Fname = 'John' AND Lname = 'Doe'
Risultati
ID Fname Lname
----------- ----- ------
1 John Doe
3 John Doe
(2 rows affected)