Skip to content

Instantly share code, notes, and snippets.

@ayuLiao
Last active October 20, 2018 15:51
Show Gist options
  • Select an option

  • Save ayuLiao/d2a05b068669eae827a52d8e8d28f44b to your computer and use it in GitHub Desktop.

Select an option

Save ayuLiao/d2a05b068669eae827a52d8e8d28f44b to your computer and use it in GitHub Desktop.
SQL增删改查
#修改已存在数据
UPDATE table_name SET field1=new-value1, field2=new-value2
[WHERE Clause]
update loghis set dirtime='12331' where logpath='/Users/ayuliao/Downloads/temp/20181017/'
#插入数据
INSERT INTO table_name ( field1, field2,...fieldN ) VALUES
( value1, value2,...valueN );
insert into loghis (logpath,dirtime,addtime) VALUES ('ayuliao/nn','123','321')
# 查询数据
SELECT column_name,column_name FROM table_name
[WHERE Clause]
[LIMIT N][ OFFSET M]
select dirTime from loghis where logpath='/Users/ayuliao/Downloads/temp/20181020/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment