I have a table called subscribers with a name field that contains data like this:
Tom Jones
Drew Brees
Tom Brady III
I need to delete everything after the first space for each record so that it looks like:
Tom
Drew
Tom
Using this question, I assembled the following query:
select substring_index(name,' ',1) as deleteAllAfterSpace from subscribers
I get the following error:
Current selection does not contain a unique column.
When I run:
SELECT * FROM subscribers
WHERE INSTR(name
, ' ') > 0
I do get the values I'm looking for as described.
I can assure you, name column is unique? What am I doing wrong?