Unanswered: Inserting from a distinctly easy select...*snicker*
Hi all...I have taken a look at an archive search, and continue to research and play with mysel...errr...my select, but in the meantime...what am I missing?!?!?!
Here is my excruciatingly interesting insert statement
Everything works just hunky-dory, EXCEPT for...two @#$(*#& rows in my database table:
INSERT INTO dbo.WON_MutualFundNames
SELECT UPPER(FndTickerSym), FndName
WHERE FndTickerSym LIKE '[A-Z]%[X]' /* first char is A thru Z and last char is X */
GROUP BY FndTickerSym, FndName
What has befuddled me is that when I run the SELECT by itself, only ONE of the rows is returned - - only when I combine it with the insert, I get a duplicate primary key value error (the FndTickerSym is the insert-table's primary key column).
DHMBX DREYFUS YIELD MUNICIPAL BOND
dhmbx DREYFUS YIELD MUNICIPAL BOND
WTF is goin' on, dudes? And perhaps more importantly, how can I get around it?
Any suggestions are welcome
well...any except "delete the duplicate row", which I am already crafting an email about to send to the offending/offensive (I assure you, they are both) group that maintains the data in this table. However, whenever I make my database idiotproof, they always invent a craftier idiot...so I must code the insert to work if such a situation presents itself again in the future.
Thoughts? Suggestions? New Cursewords?
Non est ei similis.
I just read "100 Things To Do Before You Die". I was surprised that "Yell for help!!" wasn't one of them