In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the mysql query select sentence example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Mysql query select statement summary
Mysql query select statement summary data preparation: create tables: create table students (id int unsigned primary key auto_increment not null, name varchar (20) default', age tinyint unsigned default 0, height decimal (5jue 2), gender enum ('male', 'female', 'shemale', 'secret'), cls_id int unsigned default 0 Isdelete bit default 0) Created data: insert into students values (0recorder 'Wei Shao', 18180.00jue 2recorder 1 recorder 0), (0recorder 'Xiao Yueyue', 18180.00fue2pyrrine 1), (0meme 'Peng Yuyan', 29185.00Person1 penny 0), (0mine`Liu Dehua', 59175.00Person1Person1), (0mine` 'hibiscus', 38160.00mem2flor0), (0) 'Sister Feng', 28150.00pr, 28150.00), (0recorder 'Wang Zuxian', 18172.00), (0recorder 'Jay Chou', 36 null 1), (0meme 'Cheng Kun', 27181.00 1), (0mel 'Liu Yifei', 25166.00), (0mel 'Venus', 33162.00), (0) 'Jingxiang', 12180.000.2jue 4jue 0), (0mineZhou Jie, 34176.00pr 2jing5jue 0) 1 query all fields: select * from table name; for example, select * from students;-query all information in students table 2 specified field query: select column 1, column 2,..., column n from table name; for example, select students.id, students.name from students-- generally listed as a database. Table. Column, database and table names can be omitted. Table names cannot be omitted when querying multiple tables: aliases can be given by as keywords: for example: select s.id, s.name from students as s; can also list aliases: for example, select id as number, name as name from students; aliases with as, as can be omitted, column names or table names and aliases: for example: select s.id number, s.name name from students s 3 deduplicated row query (deduplicated) distinct: select distinct column 1, column 2 from table name; for example: select distinct id, name, gender from students;-when querying multiple columns, each piece of data is repeated as a whole. 4 condition where select * from table name where condition; for example, select * from students where id = 1; multiple operators are supported after where: comparison operator, logical operator, fuzzy query, range query, null judgment 4.1 comparison operator: equal to equal to > less than
< 大于等于>Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.