Official Amended Collector's Edition SQL Statement Encyclopedia (3)

----Date function----

DAY() --The function returns the date value in date_expression
MONTH() --The function returns the month value in date_expression
YEAR() --The function returns the year value in date_expression
DATEADD(<datepart>,<number>,date>)
- -The function returns the new date
DATEDIFF(<datepart>,<number>,date>) of the specified date plus the specified extra date interval number DATEDIFF(<datepart>,<number>,date>)
--The function returns the difference between two specified dates in datepart
DATENAME(<datepart >,<date>) --The function returns the specified part of the date in the form of a string
DATEPART(<datepart>,<date>) --The function returns the specified part of the date in the form of an integer value
GETDATE() --The function uses DATETIME The default format for returns the system's current date and time

----System Functions----

APP_NAME() --The function returns the name of the currently executing application
COALESCE() --The function returns the value of the first non-NULL expression in many expressions
COL_LENGTH(<'table_name'>, <'column_name'>) -- The function returns the length value of the specified field in the table
COL_NAME(<table_id>,<column_id> ) --The function returns the name of the specified field in the table, that is, the column name
DATALENGTH() --The function returns the actual length of the data in the data expression
DB_ID([ 'database_name']) --The function returns the number of the database
DB_NAME(database_id) --The function returns the name of the database
HOST_ID() --The function returns the name of the server computer
HOST_NAME() --The function returns the name of the server computer
IDENTITY([ , seed increment]) [AS column_name])
--IDENTITY() function is only used in the SELECT INTO statement to insert an identity
column into the new table

/*select identity(int, 1, 1) as column_name

into newtable

from oldtable*/

ISDATE() --The function judges whether the given expression is a reasonable date
ISNULL(<check_expression>, <replacement_value>) --The function replaces the NULL value in the expression with the specified value ISNUMERIC() --The function judges the given Whether the specified expression is a reasonable value
NEWID() -- The function returns a value of type UNIQUEIDENTIFIER

NULLIF(<expression1>, <expression2>)

--NULLIF function returns NULL value when expression1 and expression2 are equal, otherwise returns the value of expression1

reserved words in sql

action add aggregate all
alter after and as
asc avg avg_row_length auto_increment
between bigint bit binary
blob bool both by
cascade case char character
change check checksum column
columns comment constraint create
cross current_date current_time current_timestamp
data database databases date
datetime day day_hour day_minute
day_second dayofmonth dayofweek dayofyear
dec decimal default delayed
delay_key_write delete desc describe
distinct distinctrow double drop
end else escape escaped
enclosed enum explain exists
s file first float
float4 float8 flush foreign
from for full function
global grant grants group
having heap high_priority hour
hour_minute hour_second hosts identified
ignore in index infile
inner insert insert_id int
integer interval int1 int2
int3 int4 int8 into
if is isam join
key keys kill last_insert_id
leading left length like
lines limit load local
lock logs long longblob
longtext low_priority max max_rows
match mediumblob mediumtext mediumint
middleint min_rows minute minute_second
modify month monthname myisam
natural numeric no not
null on optimize option
optionally or order outer
outfile pack_keys partial password
precision primary procedure process
processlist privileges read real
references reload regexp rename
replace restrict returns revoke
rlike row rows second
select set show shutdown
smallint soname sql_big_tables sql_big_selects
sql_low_priority_updates sql_log_off sql_log_update sql_select_limit
sql_small_result sql_big_result sql_warnings straight_join
starting status string table
tables temporary terminated text then time timestamp tinyblob
tinytext tinyint trailing to type use using unique
unlock unsigned update usage
values varchar variables varying
varbinary with write when
where year year_month zerofill

Java300 set course! Java zero-based Xiaobai self-study Java must-have high-quality tutorial


Follow "BlankLB", you can get a lot of programming materials source code courseware without waste

Guess you like

Origin blog.csdn.net/lghtdw1314/article/details/124177240