Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


mySQL update insert

Posted on 2011-04-24
Medium Priority
Last Modified: 2012-05-11
I am trying to execute this mySQL statement here but it isn't working here is the code

Open in new window

UPDATE LISTINGS SET creationDate = (SELECT CONCAT('-','year','month','day') from LISTINGS);

basically its a old table that has YY,MM,DD in separate columns i want to combine them into one field called creationDate with the proper mySQL date format.  
Question by:stargateatlantis
LVL 39

Expert Comment

by:Aaron Tomosky
ID: 35457972
Get rid of the select, from listings.
LVL 41

Accepted Solution

Sharath earned 2000 total points
ID: 35458323
try like this.
   SET creationDate = CONCAT('-','year','month','day');

Open in new window


Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question