-
数据库的新建和打开
-
数据查询语句
一、SELECT子句
一
SELECT ( 所有列 * 或输入 指定列的名称)
FROM (所查询表的名称)
WHERE (值的特定要求)
ORDER BY (排序的列)
a. 用不用是optional的
b. 但是顺序不容改变,否则出现语法错误
c. 注释 -- (--后有空格)


不懂 这个数字是在查询什么

二
查询时的加减乘除运算



在改数据表+避免重复项这里犯了两个错误
@1 修改后没点右下角的apply
@2 没写USE (数据库名称) / 没有选中sql_store进行表的查询

在习题里犯了一个错误
select这一行结束后不能加;
二、筛选符号
不等符号 <> !=

日期要用单引号'2004-09-01'

AND OR NOT
优先级: AND>OR


IN

BETWEEN
LIKE
'%b' %表示任意长的字符
'_b_' _表示一个字符


错误在OR后面没有接完整的条件语句
REGEXP
^ 字符开头
字符结尾$

|logical 
字母组合 [gmi]e e[gmi]

IS NULL/ IS NOT NULL


SELECT 和 ORDER的变量不必相关

@1 10 AS points is used to create a derived column in the result set. This means that every row in the result will have a column named points with the value 10.

@2 ORDER BY 1,2: This orders the result set based on the columns in the first and second positions of the SELECT list. Specifically:
1refers to the first column in theSELECTlist, which isfirst_name.2refers to the second column in theSELECTlist, which islast_name.

显示新行的方法

LIMIT 第一个数字(偏移量) , 第二个数字(取数量)

2724

被折叠的 条评论
为什么被折叠?



