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

x
?
Solved

mySQL update insert

Posted on 2011-04-24
2
Medium Priority
?
237 Views
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.  
0
Comment
Question by:stargateatlantis
2 Comments
 
LVL 39

Expert Comment

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

Accepted Solution

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

Open in new window

0

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