I'm trying to perform a
INSERT|UPDATE by selecting data from another DB and this is what I have so far:
INSERT INTO pdone.reps (veeva_rep_id,display_name,username,`first`,`last`,email) SELECT Id, CONCAT(UCASE(LEFT(firstname, 1)),UCASE(LEFT(lastname, 1)),username, firstname, lastname, email FROM veeva.`user` WHERE Id = "00580000003UB5VAAW"
- First problem, I got this error:
[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'from veeva.
userWHERE Id = "00580000003UB5VAAW"' at line 1
and I'm not sure what is wrong on the query, any advice?
firstnamecould be JOHN or John or jOhn or any and I want to normalize as John, is
UCASE(LEFT(firstname, 1)fine for this? The same apply to
firstnameis JOHN and
lastnameis DOE then
John Doewith a space between them, is my
- I should insert some statics fields like one URL or just
VEEVAhow I can do that? Values are not present on the query shown here but is just add two more columns to the insert
- I am planning to add
ON DUPLICATE KEY UPDATEbut can be possible to add a restriction based on a column? Lets said UPDATE only if now >