ERROR 1064 (42000): 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 '1016' at line 1 mysql> delete from emp where empid=1011 or empid=1016; Query OK, 2 rows affected (0.00 sec)
mysql> update emp set salary=salary+(salary*20/1000;
ERROR 1064 (42000): 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 1 mysql> update emp set salary=salary+(salary*20/1000); Query OK, 8 rows affected (0.00 sec) Rows matched: 8 Changed: 8 Warnings: 0
mysql> select*from emp where doj="2014-01-01",doj="2014-12-31";
ERROR 1064 (42000): 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 'doj="2014-12-31"' at line 1 mysql> select*from emp where doj<"2014-01-01" and doj>"2014-12-31"; Empty set (0.00 sec)
mysql> select*from emp where doj>="2014-01-01" and doj<="2014-12-31";
+-------+--------+------------+---------+--------+------+--------+ | empid | ename | doj | city | salary | comm | deptno | +-------+--------+------------+---------+--------+------+--------+ | 1012 | Kartik | 2014-01-31 | Mumbai | 48960 | NULL | 30 | | 1015 | Mansi | 2014-02-05 | Chennai | 36720 | NULL | 10 | | 1019 | Paul | 2014-06-08 | Chennai | 44880 | NULL | 20 | +-------+--------+------------+---------+--------+------+--------+ 3 rows in set (0.00 sec)
mysql> select ename,salary where ename like %i_;
ERROR 1064 (42000): 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 'where ename like %i_' at line 1 mysql> select ename,salary where ename like "%i_"; ERROR 1064 (42000): 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 'where ename like "%i_"' at line 1 mysql> select ename,salary where ename like "%i_"; ERROR 1064 (42000): 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 'where ename like "%i_"' at line 1 mysql> select ename,salary from emp where ename like "%i_"; +--------+--------+ | ename | salary | +--------+--------+ | Kartik | 48960 | | Rohit | 47940 | | Gloria | 61200 | +--------+--------+ 3 rows in set (0.00 sec)
mysql> select distinct city from emp;
+---------+ | city | +---------+ | Mumbai | | Kolkata | | Delhi | | Chennai | +---------+ 4 rows in set (0.00 sec)
mysql> select*from emp where deptno=10 or deptno=30;
mysql> select ename,city fromemp where city!="mumbai";
ERROR 1064 (42000): 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 'where city!="mumbai"' at line 1 mysql> select ename,city from emp where city!="mumbai"; +--------+---------+ | ename | city | +--------+---------+ | Dhruv | Kolkata | | Shreya | Delhi | | Mansi | Chennai | | Rohit | Delhi | | Paul | Chennai | | Gloria | Delhi | +--------+---------+ 6 rows in set (0.00 sec)