Mysql Error Code 1064 Insert Into Select
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies mysql error 1064 insert 42000 of this site About Us Learn more about Stack Overflow the company mysql error 1064 insert query Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges mysql error 1064 insert into Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute:
Mysql Error 1064 (42000)
Sign up Error 1064 - SQL syntax in MySQL for an INSERT statement [closed] up vote 0 down vote favorite i am trying this query but didn't work. ERROR: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= (SELECT id_university FROM university WHERE mysql error 1064 create table university = "xxx") , `singl' at line 2 INSERT INTO `database_charts`.`university_has_single_user` ( `university_id_university` = (SELECT id_university FROM university WHERE university = "xxx") , `single_user_users_id_user` = (SELECT users_id_user FROM single_user WHERE users_id_user = "1" ), `course_id_course`= (SELECT id_course FROM course WHERE course = "yyy"), `year`= "2000" ) How can this be solved? mysql mysql-error-1064 share|improve this question edited Jun 13 '11 at 18:30 p.campbell 56.1k49187271 asked Jun 13 '11 at 18:06 loops 5,35994574 closed as too localized by Jocelyn, Bill the Lizard May 5 '13 at 14:37 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question. 1 1) What do you want to achieve? 2) What do you mean this "didn't work"? –Tadeck Jun 13 '11 at 18:08 This isn't a question (catb.org/~esr/faqs/smart-que
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting error 1064 mysql 42000 create table ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the
Mysql Insert Into
Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up ERROR 1064 (42000) - MySQL error in INSERT … SELECT query up vote 0 down vote favorite As part of a MySQL trigger I'm writing, I've got an INSERT ... SELECT query that is returning : ERROR 1064 (42000) http://stackoverflow.com/questions/6334309/error-1064-sql-syntax-in-mysql-for-an-insert-statement at line 7: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'pp2 (curr_code, pricing_id, pid, title, startdate, enddate, priority, enabled) S' at line 33 INSERT INTO product_pricing pp2 (curr_code, pricing_id, pid, title, startdate, enddate, priority, enabled) SELECT cc, `pp1`.`pricing_id`, `pp1`.`pid`, `pp1`.`title`, `pp1`.`startdate`, `pp1`.`enddate`, `pp1`.`priority`, `pp1`.`enabled` FROM product_pricing pp1 WHERE pp1.pp_id = NEW.pp_id ON DUPLICATE KEY UPDATE pp2.pp_id=(SELECT newppid := pp2.pp_id); I'm not sure if it's http://stackoverflow.com/questions/25309714/error-1064-42000-mysql-error-in-insert-select-query the cc part? That's a declared variable in the trigger but it should work given that you should be able to do a SELECT 'hello', t.col1 FROM table t Any suggestions as to what the error is greatly received. mysql sql share|improve this question edited Aug 14 '14 at 13:56 Barranka 12.4k82859 asked Aug 14 '14 at 13:50 glambert 4915 First thing : INSERT INTO [...] VALUES [...] is the syntax. Where is your VALUES ? –Kabulan0lak Aug 14 '14 at 13:58 @Kabulan0lak There's also INSERT INTO ... SELECT. The SELECT provides the values. –Thorsten Dittmar Aug 14 '14 at 14:00 @ThorstenDittmar Hum ok I didn't know. Thanks ! –Kabulan0lak Aug 14 '14 at 14:14 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote accepted The INSERT syntax doesn't allow for aliases. INSERT INTO table [ ( column [, ...] ) ] { DEFAULT VALUES | VALUES ( { expression | DEFAULT } [, ...] ) [, ...] | query } [ RETURNING * | output_expression [ [ AS ] output_name ] [, ...] ] share|improve this answer answered Aug 14 '14 at 13:59 Thiago Franca 1,5141415 Didn't realise that but makes sense in hindsight, thanks! –glambert Aug 14 '14 at 14:33 add a comment| up vote 0 down vote Remove that pp2 from the INSERT query share|improve this answer answered Aug 14 '14 at 14:00 LHristov 767313 add a comment| Your Answer
DOMAINS WEB DESIGN WEB DESIGN SERVICES CREATE YOUR OWN WEBSITE SITE HOSTING TOOLS MEET US MEET US ABOUT US PARTNERS & AWARDS BLOG WE'RE HIRING CONTACT http://www.inmotionhosting.com/support/website/database-troubleshooting/error-1064 US AMP LOGIN SUPPORT CENTER Search Support Center Product Guides Dedicated Hosting Reseller Hosting KnowledgeBase Website Email Domain Names Reseller Billing Community Support Browse Questions Ask a Question User Submitted Articles Education Channels Android BoldGrid cPanel DokuWiki Drupal 7 Drupal 8 Everything Email Joomla 2.5 Joomla 3.1 K2 Magento 1.6 Mambo MediaWiki Moodle Movable Type OpenCart mysql error OpenCart 2.0 osCommerce PHP-Fusion PHP-Nuke phpBB phpList Premium Website Builder PrestaShop 1.5 PrestaShop 1.6 SMF Tiki Wiki VirtueMart 3 Web Hosting Manager Website Design WordPress Tools & Resources Email Configuration Blacklist Check Visual DNS Lookup Quick Tagger Icon Sets Favicon Generator Bounce Back Parser What is my IP address? >>Website .htaccess (17)Adobe Flash (2)APIs (2)Backup and mysql error 1064 Restore (15)Billing (8)Browser Issues (2)Connecting to a Database (5)cPanel (26)cPanel Account Management (16)Cron Jobs (4)Cube Cart (2)Database Setup (5)Database Troubleshooting (6)Domain Management (2)Dreamweaver (12)Drush (2)eCommerce (7)Elasticsearch (4)Fantastico (4)File Management (16)File Manager (6)FTP (10)FTP Client Setup (21)General Server Setup / Management (15)Getting Started Guides (18)Ghost (3)Google Tools (21)How To (23)HTML (2)Image Editing (2)IP Addresses (3)iWeb (1)JavaScript (2)Joomla (10)Joomla 2.5 (36)Koken (11)Linux (27)Logaholic (5)Magento (2)Maintaining Your Website (1)Managing Files (7)Microsoft FrontPage (11)Microsoft Publisher (1)ModSecurity (7) MODx (3)New Customers (7)Open Classifieds (1)PCI Compliance (7)PHP (15)PHP Configuration (7)PHP Troubleshooting (6)phpBB (25)phpMyAdmin (10)Premium Website Builder (22)Prestashop (1)Protecting Files (5)Publishing Your Site (2)Python (1)Redirects (4)Restricting Bots (5)Search Engine Optimization (1)Secure Socket Layer (SSL) Tutorials (13)Security (12)Sending Email From Websites (2)Server Security (2)Server Usage (21)Slow Websites (7)Social Media (4)Software FAQs (11)Soho Web Builder (18)SSH and Root access (21)Statistics/Logging (12)Troubleshooting Comment Spam (3)Troubleshooting Hacked Websites (9)Web Host Manager (7)Website Error Numbers (4)Website Is Unavailable (3)Website Transfers (6)Website Troubleshooting (26)Welcome to AMP (22)What Is... (9)WooCommerce (5)WordPress (102)WordPress Development (12)Wordpress Plugins (59)Wordpress Themes (6)Working with D