sqyog報錯

sqyog報錯

報錯提示:
There was error(s) while executing the queries .
The query and the error message has been logged at:
C:\Users\50800\AppData\Roaming\SQLyog\sqlyog.err.
Please click on “Open Error File…” to open the error file.

報錯文件提示:
查詢:

SELECT last_name , job_id , salary AS sal
FROM employees;

出錯處:2020-03-21 19:25:05

行號:3

錯誤代碼: 1146 - Table ‘girls.employees’ doesn’t exist查詢:

SELECT last_name , job_id , salary AS sal
FROM employees;

出錯處:2020-03-21 19:37:04

行號:3

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

/*
語法:
select
查詢列表
from
表名
where
篩選條件;
分類:
一、按條件表達式篩選

簡單條件運算符:> < = != <> >= <=

二、按邏輯表達式篩選
邏輯運算符:
作用:用於連接條件表達式
	&& || !
	and or not
	
&&和and:兩個條件都爲true,結果爲true,反之爲false
||或or: 只要有一個條件爲true,結果爲true,反之爲false
!或not: 如果連接的條件本身爲false,結果爲true,反之爲false

三、模糊查詢
	like
	between and
	in
	is null

*/
SELECT
*
FROM
employees
WHERE
salary>12000

出錯處:2020-03-21 19:38:47

行號:43

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

/*
語法:
select
查詢列表
from
表名
where
篩選條件;
分類:
一、按條件表達式篩選

簡單條件運算符:> < = != <> >= <=

二、按邏輯表達式篩選
邏輯運算符:
作用:用於連接條件表達式
	&& || !
	and or not
	
&&和and:兩個條件都爲true,結果爲true,反之爲false
||或or: 只要有一個條件爲true,結果爲true,反之爲false
!或not: 如果連接的條件本身爲false,結果爲true,反之爲false

三、模糊查詢
	like
	between and
	in
	is null

*/
SELECT
*
FROM
employees
WHERE
salary>12000

出錯處:2020-03-21 19:38:57

行號:43

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
department_id
FROM
employees
WHERE
department_id<>90

出錯處:2020-03-21 19:38:57

行號:53

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
salary,
commission_pct
FROM
employees
WHERE
salary>=10000 AND salary<=20000;

出錯處:2020-03-21 19:38:57

行號:66

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
*
FROM
employees
WHERE
NOT(department_id>=90 AND department_id<=110) OR salary>15000

出錯處:2020-03-21 19:38:57

行號:73

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

/*
like

between and
in
is null|is not null
/
/

特點:
①一般和通配符搭配使用
通配符:
% 任意多個字符,包含0個字符
_ 任意單個字符

select
*
from
employees
where
last_name like ‘%a%’;#abc
select
last_name,
salary
FROM
employees
WHERE
last_name LIKE ‘__n_l%’;
SELECT
last_name
FROM
employees
WHERE
last_name LIKE ‘_KaTeX parse error: Expected group after '_' at position 1: _̲%' ESCAPE '’;
/

①使用between and 可以提高語句的簡潔度
②包含臨界值
③兩個臨界值不要調換順序
*/
SELECT
*
FROM
employees
WHERE
employee_id >= 120 AND employee_id<=100

出錯處:2020-03-21 19:38:57

行號:137

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
*
FROM
employees
WHERE
employee_id BETWEEN 120 AND 100

出錯處:2020-03-21 19:38:57

行號:144

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

/*
含義:判斷某字段的值是否屬於in列表中的某一項
特點:
①使用in提高語句簡潔度
②in列表的值類型必須一致或兼容
③in列表中不支持通配符

*/
SELECT
last_name,
job_id
FROM
employees
WHERE
job_id = ‘IT_PROT’ OR job_id = ‘AD_VP’ OR JOB_ID =‘AD_PRES’

出錯處:2020-03-21 19:38:57

行號:164

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
job_id
FROM
employees
WHERE
job_id IN( ‘IT_PROT’ ,‘AD_VP’,‘AD_PRES’)

出錯處:2020-03-21 19:38:57

行號:175

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

/*
=或<>不能用於判斷null值
is null或is not null 可以判斷null值
*/
SELECT
last_name,
commission_pct
FROM
employees
WHERE
commission_pct IS NULL

出錯處:2020-03-21 19:38:57

行號:194

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
commission_pct
FROM
employees
WHERE
commission_pct IS NOT NULL

出錯處:2020-03-21 19:38:57

行號:204

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
commission_pct
FROM
employees
WHERE
salary IS 12000

出錯處:2020-03-21 19:38:57

行號:214

錯誤代碼: 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 ‘12000’ at line 7查詢:

SELECT
last_name,
commission_pct
FROM
employees
WHERE
commission_pct <=>NULL

出錯處:2020-03-21 19:38:57

行號:227

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
salary
FROM
employees
WHERE
salary <=> 12000

出錯處:2020-03-21 19:38:58

行號:238

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

IS NULL:僅僅可以判斷NULL值,可讀性較高,建議使用
<=> :既可以判斷NULL值,又可以判斷普通的數值,可讀性較低

出錯處:2020-03-21 19:38:58

行號:269

錯誤代碼: 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 ‘IS NULL:僅僅可以判斷NULL值,可讀性較高,建議使用
<=> :既’ at line 1查詢:

/*
語法:
select
查詢列表
from
表名
where
篩選條件;
分類:
一、按條件表達式篩選

簡單條件運算符:> < = != <> >= <=

二、按邏輯表達式篩選
邏輯運算符:
作用:用於連接條件表達式
	&& || !
	and or not
	
&&和and:兩個條件都爲true,結果爲true,反之爲false
||或or: 只要有一個條件爲true,結果爲true,反之爲false
!或not: 如果連接的條件本身爲false,結果爲true,反之爲false

三、模糊查詢
	like
	between and
	in
	is null

*/
SELECT
*
FROM
employees
WHERE
salary>12000

出錯處:2020-03-21 19:38:59

行號:43

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
department_id
FROM
employees
WHERE
department_id<>90

出錯處:2020-03-21 19:38:59

行號:53

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
salary,
commission_pct
FROM
employees
WHERE
salary>=10000 AND salary<=20000

出錯處:2020-03-21 19:38:59

行號:66

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
*
FROM
employees
WHERE
NOT(department_id>=90 AND department_id<=110) OR salary>15000

出錯處:2020-03-21 19:38:59

行號:73

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

/*
like

between and
in
is null|is not null
/
/

特點:
①一般和通配符搭配使用
通配符:
% 任意多個字符,包含0個字符
_ 任意單個字符

select
*
from
employees
where
last_name like ‘%a%’;#abc
select
last_name,
salary
FROM
employees
WHERE
last_name LIKE ‘__n_l%’;
SELECT
last_name
FROM
employees
WHERE
last_name LIKE ‘_KaTeX parse error: Expected group after '_' at position 1: _̲%' ESCAPE '’;
/

①使用between and 可以提高語句的簡潔度
②包含臨界值
③兩個臨界值不要調換順序
*/
SELECT
*
FROM
employees
WHERE
employee_id >= 120 AND employee_id<=100

出錯處:2020-03-21 19:38:59

行號:137

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
*
FROM
employees
WHERE
employee_id BETWEEN 120 AND 100

出錯處:2020-03-21 19:38:59

行號:144

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

/*
含義:判斷某字段的值是否屬於in列表中的某一項
特點:
①使用in提高語句簡潔度
②in列表的值類型必須一致或兼容
③in列表中不支持通配符

*/
SELECT
last_name,
job_id
FROM
employees
WHERE
job_id = ‘IT_PROT’ OR job_id = ‘AD_VP’ OR JOB_ID =‘AD_PRES’

出錯處:2020-03-21 19:38:59

行號:164

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
job_id
FROM
employees
WHERE
job_id IN( ‘IT_PROT’ ,‘AD_VP’,‘AD_PRES’)

出錯處:2020-03-21 19:38:59

行號:175

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

/*
=或<>不能用於判斷null值
is null或is not null 可以判斷null值
*/
SELECT
last_name,
commission_pct
FROM
employees
WHERE
commission_pct IS NULL

出錯處:2020-03-21 19:38:59

行號:194

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
commission_pct
FROM
employees
WHERE
commission_pct IS NOT NULL

出錯處:2020-03-21 19:38:59

行號:204

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
commission_pct
FROM
employees
WHERE
salary IS 12000

出錯處:2020-03-21 19:38:59

行號:214

錯誤代碼: 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 ‘12000’ at line 7查詢:

SELECT
last_name,
commission_pct
FROM
employees
WHERE
commission_pct <=>NULL

出錯處:2020-03-21 19:38:59

行號:227

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

SELECT
last_name,
salary
FROM
employees
WHERE
salary <=> 12000

出錯處:2020-03-21 19:38:59

行號:238

錯誤代碼: 1109 - Unknown table ‘employees’ in information_schema查詢:

IS NULL:僅僅可以判斷NULL值,可讀性較高,建議使用
<=> :既可以判斷NULL值,又可以判斷普通的數值,可讀性較低

出錯處:2020-03-21 19:38:59

行號:269

錯誤代碼: 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 ‘IS NULL:僅僅可以判斷NULL值,可讀性較高,建議使用
<=> :既’ at line 1查詢:

SELECT employee_id,job_id,last_name
FROM employees
ORDER BY department_id DESC ,city salary

出錯處:2020-03-22 13:27:57

行號:6

錯誤代碼: 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 ‘salary’ at line 3查詢:

SELECT employee_id,job_id,last_name
FROM employees
ORDER BY department_id DESC ,city salary

出錯處:2020-03-22 13:28:31

行號:6

錯誤代碼: 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 ‘salary’ at line 3查詢:

SELECT employee_id,job_id,last_name
FROM employees
ORDER BY department_id DESC ,city salary

出錯處:2020-03-22 13:48:32

行號:6

錯誤代碼: 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 ‘salary’ at line 3查詢:

SELECT employee_id,job_id,last_name
FROM employees
ORDER BY department_id DESC ,city salary

出錯處:2020-03-22 13:48:44

行號:6

錯誤代碼: 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 ‘salary’ at line 3查詢:

SELECT employee_id,job_id,last_name
FROM employees
ORDER BY department_id DESC ,city salary

出錯處:2020-03-22 14:02:04

行號:6

錯誤代碼: 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 ‘salary’ at line 3查詢:

SELECT employee_id,job_id,last_name
FROM employees
ORDER BY department_id DESC ,city salary

出錯處:2020-03-22 14:02:17

行號:6

錯誤代碼: 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 ‘salary’ at line 3查詢:

SELECT employee_id,job_id,last_name
FROM employees
ORDER BY department_id DESC ,city salary

出錯處:2020-03-22 14:02:28

行號:6

錯誤代碼: 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 ‘salary’ at line 3查詢:

SELECT employee_id,job_id,last_name
FROM employees
ORDER BY department_id DESC ,city salary

出錯處:2020-03-22 14:04:19

行號:6

錯誤代碼: 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 ‘salary’ at line 3

怎麼解決

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章