-- NicknameAmbivalent.sql

/*
2015-12-30 Tom Holden ve3meo
Returns Record Number and Names of Persons who have both an embedded Nickname
and a value in the Nickname field. These cannot be processed
by NickGivenCombine.sql and NickGivenSplit.sql and should be
resolved in the database with one or the other but not both.

Includes those having parentheses to denote nickname in the Given field
instead of quotes; parentheses not supported by other scripts in this series.
*/

SELECT OwnerID AS RIN, NameID, Surname, Given, Nickname
FROM NameTable
WHERE LENGTH(NickName)
AND (INSTR(Given,'"') OR INSTR(Given, '('))
;