Menu
  • HOME
  • TAGS

UPDATE table using CONCAT_WS error

mysql,sql,concat,concat-ws

I think an update-join statement is what you're looking for: UPDATE week2 JOIN (SELECT voternum, GROUP_CONCAT(voterhistory ORDER BY voterhistory SEPARATOR ',') AS history FROM vhistory GROUP BY voternum) h ON week2.voternum = h.voternum SET voterhistory = history ...

Mysql Inner join with concat_ws

mysql,concat-ws

I am giving a blind try. Nothing changed much except a date() conversion to tb2.date_extract-taking the date value if date_extract is of type TIMESTAMP or DATETIME. SELECT tb1.*,tb2.*, CONCAT_WS("_",tb2.`N1`, tb2.`N2`) AS `GR`, FROM table2 tb2 INNER JOIN table1 tb1 ON tb1.`namegroup`= tb2.GR WHERE date(tb2.`date_extract`) = "2015-02-13" If this is not...