Questions tagged [mysql-error-1064]

1

votes
2

answer
30

Views

MySQL returns wrong results with the BETWEEN clause

I am using the following query to get data from mysql database and I get wrong data. I want to show release_year from 1990 ~2000, but it's showing me everything. SELECT title,release_year FROM FILMS WHERE release_year BETWEEN 1990 AND 2000 AND budget > 1000000000 AND language ='Spanish' OR language...
LenaLD
1

votes
0

answer
55

Views

Why can't MySQL refer to a temporary table twice?

The MySQL docs state: You cannot refer to a TEMPORARY table more than once in the same query. as a 'known limitation'. However, I'm curious why MySQL has this quirk. Unfortunately, most answers to questions about it stop at 'the docs say...'. Could somebody with insight into how MySQL works provide...
g_sue
1

votes
2

answer
221

Views

Why the cursor returns null INTO variables but the query returns rows?

I have this stored procedure in MySQL, its suposed that should works but it doesn't. I put a table called logs to log the values, to see what is going on there: DELETE FROM LOGS; CALL fixRegistrationsGroups; SELECT * FROM LOGS; This returns in the logs table this: BEFORE LOOP registrationsIds NULL r...
1

votes
0

answer
47

Views

Error in MySQL syntax while using raw command in Django

In a function in views.py, I am trying to access the header columns(column names) of a table using a SQL query, and use it. I am using a MYSQL database for my Django project. However, I am getting the following error: 'You have an error in your SQL syntax; check the manual that corresponds to your M...
1

votes
1

answer
185

Views

While Loop in MySql

I'm struggling to figure out the correct syntax to use in MYSQL. label1: WHILE income
Lax Mandis
1

votes
1

answer
35

Views

FUNCTION <database_name>. TOP does not exist

This message was shown when I used String sql = 'SELECT TOP(1) order_id FROMordersORDER BY order_id DESC; '; the data gets updated in the table but the after String sql = 'SELECT TOP(1) order_id FROMordersORDER BY order_id DESC; '; the next line of code are not running, I mean the rs.next() statemen...
tushar
1

votes
1

answer
65

Views

Running into character issues while trying to migrate a PostgreSQL database to a MySQL database using MySQL Workbench

The PostgreSQL instance I'm using as my source database is using UTF-8 encoding and a cp1252 charset/collation. I'm trying to use a utf8mb4/utfmb4_unicode_520_ci charset/collation on my target database. I set all relevant server/client charset arguments to utf8mb4/utfmb4_unicode_520_ci to ensure tha...
x n
1

votes
1

answer
98

Views

Trying to restore data from MySQL Workebench 6.3 to MySQL Workbench 8.0

I am trying to move my data/tables/everything from a MySQL 6.3 CE Workbench to MySQL 8.0 CE. When I just tried initally, I had and fixed this error - Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER' . Now I have a new error that I cannot figure out - ERROR 1359 (HY000) at line...
bjk116
1

votes
0

answer
14

Views

Error with putting SELECT SUM into an IF statement

I encounter an error with code 1064 in my SQL statement but I cannot see where it is wrong. I want to sum all the ETCS of all modules that a student have take part in. I have tried and the SELECT SUM statement is correct an return the sum. However when I put it in an IF statement, error code 1064 i...
Rakon Nguyen
1

votes
1

answer
34

Views

I cannot figure out what wrong on MySQL keep getting error 1064

Executing SQL script in server ERROR: 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 'VISIBLE, CONSTRAINT fk_WEEK_WORKOUT FOREIGN KEY (WORKOUT_IdWorkout) ' at line 12 SQL Code: -- ---------------------...
Bee
1

votes
1

answer
22

Views

Getting error Error Code: 1064. You have an error in your SQL syntax

I am new to MYSQL and I was trying to do an inner join but one of the columns is named TS%. It seems that the symbol at the end is causing this problem because when I remove this column it works just fine SELECT Players.Player, Players.college, Seasons_Stats.Year, Seasons_Stats.Pos, Seasons_Stats.TS...
Desiree C. Ferrer
1

votes
1

answer
2.2k

Views

MySQL @variable

I'm trying to set up a MySQL trigger, but I can't figure out how exactly to get what I want done. I think I need to set up a MySQL @variable but what I've tried hasn't worked and I have not been able to find a good resource figure it out. I change the delimiter in phpMyAdmin, and the comment in the...
Nona Urbiz
1

votes
2

answer
610

Views

MySQL temp table issue

I'm trying to use temp tables to speed up my MySQL 4.1.22-standard database and what seems like a simple operation is causing me all kinds of issues. My code is below.... CREATE TEMPORARY TABLE nonDerivativeTransaction_temp ( accession_number varchar(30), transactionDateValue date) ) TYPE=HEAP; INS...
AmyD
1

votes
1

answer
776

Views

Error Code 1064 MySQL

I need to know what i am doing wrong right now in this. Can someone tell me how to fix it? mysql>host/'localhost'; mysql>port=3306; database=ml username=**** password=******** clientamount=30; I need to know how to fix the first line can anybody tell me?
hartfelt
1

votes
2

answer
712

Views

mysql sorting and between using a sub query

I am executing a query in which i use joins. In that i have used a subquery which will total amount. i want to sort by the result of the subquery like the following. 'select users.*, (select sum(amount) as camount from donation where donation.uid=users.id) as camount from users where users.confirme...
Jach Many
1

votes
5

answer
322

Views

MySQL query problem with 'like' and confusion

I need to use a string query to make a DB search for a C# program that interacts with MySQL server. What I want to find is a name that is 'like' one of my other variables (nameVar) I have the following query in a C# program string q = 'SELECT * FROM TABLE WHERE name is like %?nameVar%'; As soon as...
1

votes
3

answer
495

Views

MySQL adds column name to beginning of the result

Hopefully this is just quick fix, but when I execute any select query, such as, SELECT table_name FROM table_info WHERE load_order IS NOT NULL ORDER BY load_order; it always prepends the column name to the result. In this case, the result is, table_name settings tax tax_rate sales_tax_zone sic n...
1

votes
4

answer
1.4k

Views

getting java.io.EOFException when trying to insert data in mysql from spring mvc app

I am trying to submit data from spring mvc app to mysql . sometime i get the following error org.springframework.dao.DataAccessResourceFailureException: StatementCallback; SQL [insert into networkwithusdb(company,firstname,lastname,email,address1,address2,city,state,zipcode,currentemployer,currentjo...
prabhat
1

votes
1

answer
203

Views

Working with MySQL control structures from C++

I suppose that I work with these MySQL control structures (see below) in absolutely wrong way. The problem is maybe in MySQL query, but I am not sure... MySQL Error: 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...
miloshavlicek
1

votes
4

answer
7.9k

Views

Access denied for user 'root'

I downloaded an adobe flex mysql script (from a tutorial I am learning) and ran the script in my sql 5.5. It created a database, but it was stored in my wamp folder under: C:\wamp\bin\mysql\mysql5.1.36\data I have a test php page that is supposed to print out the data from the database (from the ad...
Adam
1

votes
1

answer
1.2k

Views

Joomla database Export Issue

When ever i export the DB & migrate the db to another host, while importing im getting mysql error each time. Particularly issue in in importing Usergroup table. #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 n...
Parthi04
1

votes
1

answer
57

Views

Error : Inserting values from other table via variable [closed]

This is my query : set @agent_id = select agnt.id from agent agnt , session ses where ses.session_id = '0021a7ca-6e' and ses.employee_id = agnt.employee_id ; insert into inquiry_placed_by(inquiry_id , agent_id) values(1 , @agent_id); This error i get : #1064 - You have an error in your SQL syntax;...
Ravi Jain
1

votes
2

answer
158

Views

Uppercase FROM causes error 1064

I have an sql query that is already written, but the from command is lowercase. I like the formatting of it being uppercase but if I change it I get error 1064. select, where, and etc were all lowercase as well but when I change to upper they work fine, it is only the WHERE statement that causes th...
Sackling
1

votes
3

answer
1k

Views

calculating multiple percentages in a single MySQL statement

I am new to complex SQL statements and need help. I have managed to display half of the result set and struggling with remaining. Result required: PSU | pregnancy number| pregnancy percentage | % of live birth out of the pregnancy number. 1 | 2 | 67% | 40%...
user1606540
1

votes
1

answer
3.6k

Views

MySQL ERROR 1064 - MySQL Workbench [closed]

As I have searched, it is a common error and for each case the solution is different. I'm new in database designing. But what is strange to me is that this error is given to me because of running an automatic SQL command generated by MySQL Workbench! ERROR 1064: You have an error in your SQL syntax;...
daziv
1

votes
1

answer
195

Views

MySQL Throws an Error IF Function in Stored Procedure

i have some problem regarding my mysql stored procedure, the mysql always shows up error 1064, error mysql syntax. where i was wrong? DELIMITER $$ USE `itin`$$ DROP PROCEDURE IF EXISTS `sp_Transaction`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_Transaction`(IN inpt TINYINT(4), IN inpt2 TINYIN...
randytan
1

votes
2

answer
890

Views

Codeigniter : semicolon breaking query

I have a SQL file I am trying to import into my CodeIgniter application with the following method : public function run_backup($filename) // full extension please { // read the file in // make sure that filename is a string $filename = (string) $filename; $backup = $this->load->file($filename, true...
bart_88
1

votes
2

answer
8.4k

Views

Why can't I restore MYSQL dumped file?

I have successfully created a MYSQL dump on windows mysqldump -u myuname -p mydb > path/to/mydbdump.sql I uploaded the mydbdump.sql to a live linux server, created a new database and trying to use these dumped data for new database mysql -u myuname -p mynewdb < /path/to/mydbdump.sql I get this erro...
okey_on
1

votes
1

answer
1.7k

Views

SQL DELETE with JOIN another table on multiple conditions for WHERE NULL

I have to delete rows from slaveTable that have no more relation with masterTable table (dead relations, removed from masterTable). I came up with the statement: DELETE FROM slaveTable AS s LEFT JOIN masterTable AS m ON ( s.key1 = m.key1 AND s.key2 = m.key2 ) WHERE m.key1 IS NULL SQL DELET...
Tom Winter
1

votes
1

answer
85

Views

Matching names in database

I have a table in which I want to match fname and lname My query is $result = $mysqli->query('SELECT * FROM user_friend_detail WHERE userId = ''.$_SESSION['userId'].'' AND FriendFirstName = ''.mysql_real_escape_string($firstName).'' AND FriendLastName = ''.mysql_real_escape_string($lastName).'' A...
1

votes
1

answer
81

Views

Trigger only if Table if updated

I want to trigger the table after update only if any change is made in the table. I tried this but it is giving error. My code is CREATE TRIGGER Trans_SubCategory_update AFTER UPDATE ON Trans_SubCategory FOR EACH ROW BEGIN IF NEW.ts OLD.ts THEN INSERT INTO Sync_activities (table_name,table_id,adm...
Happy
1

votes
1

answer
65

Views

Run Mysql-CLuster

I am trying to test mysql-cluster but I have to run it. I succeeded installation and configuration but the last step of running doesn't work. I have a major error, when I run /home/sonia/mysqlc/bin/mysqld --defaults-file=conf/my.cnf & I get this output 2014-03-18 17:55:09 30535 [ERROR] Can't start...
user3435212
1

votes
3

answer
6.1k

Views

MySQL Workbench has encountered a p‌r‌o‌b‌l‌e‌m. MySQL doesn't start Windows 7

I have MySQL workbench installed on my computer and always worked correctly. Now try to run it and do not run. Gives an error: MySql Workbench has encountered a problem External component has throw an exception. We are sorry for the inconvenience but an unexpected exception has been raised by one of...
user3320956
1

votes
1

answer
175

Views

Calculating distance from latlang --MySQL functional error (#1064)

I am creating a function for calculating the haversian distance but in i am getting the Mysql syntax 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 '' at line 8 DELIMITER $$ CREATE FUNCTION GEODIST...
Ammar Hayder Khan
1

votes
4

answer
127

Views

How to correct Php Query for LIKE data?

I am getting a error in my PHP query. I am attempting to do the below query. However, when I put the the code in PHP. The data is not pulling the 'like' data. The search I want: 'SELECT * FROM `TABLE` WHERE `ID` like \'NAME%\''; My php code: $TABLE= $_POST['cptCode1']; $data = mysql_query('SELECT *...
Jaync31
1

votes
4

answer
236

Views

1064 error for ALTER AUTO_INCREMENT [closed]

Please help, I would like for the table 'order' to auto increment starting at 14000, but no matter what I try, I keep getting the below error? mysql> ALTER TABLE order AUTO_INCREMENT = 14000; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL se...
user3179501
1

votes
2

answer
174

Views

#1064 error message - SQL syntax [duplicate]

This question already has an answer here: How can I fix MySQL error #1064? 6 answers All I am trying to do is create a simple database to store user information they submit off my website. Here is my code: USE database_1; CREATE TABLE contact_us ( `id` INT NOT NULL AUTO_INCREMENT, `fname` VARCHAR(...
mddanielewicz
1

votes
2

answer
1.9k

Views

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

I am using Sybase Power Designer to create a database from a physical data model (Sybase creates an SQL file) . When i import the SQL file with phpMyAdmin I have the following error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the...
user3759619
1

votes
2

answer
8.2k

Views

Error: Data source rejected establishment of connection, message from server: “Too many connections”

I have a text file that it's size is not so heavy (600KB) and my code should read this file and send whole contains to my database: private static void readBigFileAndSendToDB() throws Exception { Scanner s = new Scanner(new FileReader('tf1.txt')); while (s.hasNextLine()) { String eachLine = s.nextLi...
1

votes
1

answer
83

Views

Find contiguous numbers ranges with mysql (25.000+ table rows)

I need to find contiguous numbers ranges (min, max) from a set of 'series' (only numbers). I have written a SQL using @row_number but it works partially. If the row ID (int, primary, auto_increment) is not consecutive, it returns 2 result sets instead of just one. Check this sqlfiddle to see how t...

View additional questions