FAQ Database Discussion Community


Java JPA Queries

java,mysql,sql,jpa,mysql-error-1064
i'm trying to select all enteties from a databse where a certain date is older than 7 days. It works fine via SQLyog, but in Java it always throws this error: [33, 76] The expression is not a valid conditional expression. [76, 101] The query contains a malformed ending. This...

Error 1064 for no apparently reason

mysql,mysql-workbench,mysql-error-1064
I got this query: SELECT companies_comments.id as id, companies_comments.post as post, companies_comments.comment as comment, companies_comments.date as date, companies.`id` AS company, companies.`name` as name, companies.`username` as username, companies.`photo` as photo, companies.`status` AS company_status LEFT JOIN companies ON companies.id = companies_comments.company WHERE company_status NOT IN (3,4) AND companies_comments.post =1 The error: Error...

How to select multiple avg(column) in one select statement in MySql stored procedure?

mysql,mysql-workbench,mysql-error-1064
I find when I select one avg(column) into a variable,it is OK.But when I select more than one avg into a variable,it is wrong.I do not want to write it twice,how to fixed it? //work well SELECT avg(MathPoint) into MathPoint from student where sex=1 SELECT avg(EnglishPoint) into EnglishPoint from student...

MySQL - Write an UPDATE Query based on SELECT Query on multiple tables

mysql,sql,sql-update,mysql-error-1064
I am far from being strong in MySQL or database, so I am using a tool called FlySpeed SQL Query. This tool helps me graphically created MySQL queries. Here is the query I got created with this tool and a lot of reading on the internet. Select Employee.Firstname As Prénom,...

PhpMyAdmin - err 1064 - set variable in function

phpmyadmin,mysql-error-1064
I'm getting hard time with PhpMyAdmin. My table is : material(id_item, id_collection,...) primarey_key(id_item, id_collection). I want to make a function to prevent loop in Acyclic Graph Database. So i want to force id_collection > id_item for new id_collection. My function is (i have set // in SQL tab): // CREATE...

Syntax error preventing CREATE EVENT

mysql,database,delimiter,mysql-error-1064,ddl
CREATE EVENT demo ON SCHEDULE EVERY 2 SECOND DO BEGIN update alarm set is_on=1; END Error SQL query: CREATE EVENT demo ON SCHEDULE EVERY 2 SECOND DO BEGIN update alarm set is_on=1; MySQL said: Documentation 1064 - You have an error in your SQL syntax; check the manual that corresponds...

Unknown syntax error in MySQL statement

mysql,sql,mysql-error-1064
I am using below CREATE TABLE statement CREATE TABLE IF NOT EXISTS users ( `uuid` varchar(36) NOT NULL, `json` varchar(MAX) NOT NULL, PRIMARY KEY (`uuid`) ); However I keep getting this error. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your...

phpMyAdmin keeps throwing error #1064

phpmyadmin,mysql-error-1064
Here's the error warning I get when executing my query: My database structure: Can anyone help me find the error?...

Adding a Foreign Key from a SQL Dump fails

mysql,mysqldump,mysql-error-1064
I'm trying to create a database from an SQL Dump. I wrote it like this: CREATE DATABASE IF NOT EXISTS rsa_database; CREATE TABLE IF NOT EXISTS `keys` ( `id` int(11) NOT NULL auto_increment, `public_key` varchar(20) collate latin1_general_ci NOT NULL, `private_key` varchar(30) collate latin1_general_ci NOT NULL, PRIMARY KEY (`id`) ); CREATE...

MySQL Trigger AFTER UPDATE IF ELSE insert

mysql,mysql-error-1064,sql-server-triggers
I'm trying to make a trigger insert into a table after the update of the checkedOutBy in the equip table. It gave me an Error 1064 at lines 7, 10 and others as I have randomly changed things hoping that somehow it may just magically work. DELIMITER $$ CREATE TRIGGER...

mysql error “cannot add foreign key constraint”

mysql,foreign-keys,constraints,mysql-error-1064
Here is the mysql query: ALTER TABLE wp_juices_members ADD CONSTRAINT fk_juiceid FOREIGN KEY(juice_id) REFERENCES wp_juices(id) All the tables, fields exist with the correct names as specified in the above query, and i still get this error: "cannot add foreign key constraint" Here are the DESC for the two tables: wp_juices_members:...

I got an SQL error, trying to insert a form to the database

php,mysql,syntax-error,sql-insert,mysql-error-1064
I have no idea of what i am doing wrong. I'm trying to insert a form, to my table. Insert failed: (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 '-v, youtube-c, portfolio-link,...

MySQL error: 1064

php,mysql,sql,mysql-error-1064
I'm having the following PHP code: try{ $stmt = $db->prepare('SELECT nume,prenume FROM candidati'); $stmt->execute(); while($row = $stmt->fetch(PDO::FETCH_OBJ)){ $aux = $row->nume.' '.$row->prenume; $st = $db->prepare('SELECT COUNT(id) AS total FROM votanti WHERE consiliul_local=?'); $st->execute(array($aux)); while($r = $st->fetch(PDO::FETCH_OBJ)){ $s = $db->prepare("INSERT INTO rezultate SET obtinute=:o WHERE nume=:n AND prenume=:p"); $s->bindParam(':o',$r->total,PDO::PARAM_INT);...

MySQL Error 1064 (42000) Script Insert

mysql,mysql-error-1064,insert-into
I receive an error for any insert statement I put after load data. I have tried rearranging the insert statements but still received errors. Not sure what to do, any help would be awesome! The error is: Error: "Error 1064 (42000): ... right syntax to use near '--Load data Insert...

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 '-db'

mysql,sql,mysql-error-1064,sql-drop
I'm trying to delete a database inside an RDS MySQL instance and I get the following error . Can someone kindly help me resolve this issue [[email protected] ~]$ mysql -h wda2d.cmkridjjwpjp.ap-southeast-2.rds.amazonaws.com -u happy-p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id...

CPU usage is extremly high due to mysql process

cpu-usage,mysql-error-1064
I have a godaddy VPS box with 4 GB RAM. It has only 1 website hosted with nearly 800-1000k hits perday. upon investigation i found that my cpu usage is some times goes above 100%. The below mysql process is the culprit. Can some one help me. I have tried...

MySQL 1064 Error Creating a Linking Table (Many-to-Many)

mysql,sql,mysql-error-1064,create-table
I'm trying to understand why a parsing error occurred (1064) with the following code. <#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 '' at line 3> CREATE TABLE Party_Library ( Party...

MySQL help forward engineering

mysql,database,database-design,mysql-workbench,mysql-error-1064
So I'm trying to deploy the database that I've created on workbench 6.2 onto a real database (to test it out)... But I keep on getting errors every time I deploy it, and every time I think I've fixed the issue some other error message pops up (this time it's...

MySQL ERROR 1064 in line, but don't know what is wrong?

mysql,sql,mysql-error-1064
I've got the following line I want to execute in MySQL: CREATE TABLE 'virtual_domains' ( 'id' int(11) NOT NULL auto_increment, 'name' varchar(50) NOT NULL, PRIMARY KEY ('id')) ENGINE=InnoDB DEFAULT CHARSET=utf8; However, it gave me this error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual...

MySQL query error 1064 (syntax error)

mysql,mysql-error-1064
I'm trying to make the following query work but it seems to contain an error that I can't find. The query in question is: select A.*, SD.* from ( ( select V71.Sollevamento_idAttrezzatura, V71.Num_id_ON, V71.Affidato_INAIL, V71.Esito_Verifica, V71.Prima_Verifica, V71.Sospensione, V71.Data_Verbale, V71.Scadenza, CO.Nome, CO.Cognome, CO.CF, V71.Costo, V71.Sconto as ScontoVerbale, V71.Maggiorazione as MaggiorazioneVerbale, V71.Indirizzo,...

create procedure mysql error near ''

mysql,mysql-error-1064
My MySQL statement: CREATE PROCEDURE latest_procedure() BEGIN DELETE ac.* FROM s_articles_categories AS ac JOIN s_articles AS a ON ac.articleID = a.id WHERE ac.categoryID = 38; END I am getting the following error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL...

unable to create new user in mysql

mysql,mysql-workbench,mysql-error-1064
I am trying to create a new user in mysql 5.6, but while executing the query i am getting an error. please help. mysql> create user [email protected]'%' indentified by 'Passw0rd';<br></b> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server...