罗湖做网站公司排名,做网站如何寻找客源,西安展厅设计公司,以下属于网站页面设计的原则有上周加入数据蛙二期培训#xff0c;结束了孤独战斗的现状。断断续续自学了3个月(当然看了各种视频和各种书#xff0c;一把辛酸泪。。。)#xff0c;现在选择报班#xff0c;主要还是觉得一个靠谱的组织和团队#xff0c;可以极大缓解我学习过程中不时闪现的焦虑和无助结束了孤独战斗的现状。断断续续自学了3个月(当然看了各种视频和各种书一把辛酸泪。。。)现在选择报班主要还是觉得一个靠谱的组织和团队可以极大缓解我学习过程中不时闪现的焦虑和无助最重要的是少走弯路。毕竟青春不再年华易逝浪费可耻哈哈哈哈本文结合个人情况依据学习规划对《mysql必知必会》前9章内容关于排序和过滤操作进行知识点整理。一 . 排序子句排序select [column1] from [table] order by [column2],[column3]…..column1 与 column2 不要求相等,也可以多列排序。select prod_name from products order by prod_name;升降顺序默认升序 asc降序 descselect prod_id,prod_price,prod_name from productsorder by prod_price desc,prod_name;与 limit 组合找到最值select prod_price from productsorder by prod_price desclimit 1;image.png二 . 过滤1. 按照指定条件搜索数据whereselect [column1],[column2] from [table] where [column3]x特性1匹配时不区分大小写特性2: 用单引号限定字符串select prod_name,prod_price from productswhere prod_namefuses;image.png特性3:匹配范围可以用 between ...and...in ——见特性7特性4:where 和 order by 同时使用时order by 放后面select prod_name,prod_price from productswhere prod_price between 5 and 10order by prod_price;image.png特性5:用于检查null值select cust_id from customerswhere cust_email is null;特性6:结合逻辑操作符and orand 具有更高优先级select vend_id,prod_name,prod_pricefrom productswhere vend_id1002 or vend_id1003 and prod_priceimage.png这里搜索出来的是1003厂商制造的价格小于10美元的数据和1002制造的数据。特性7:匹配范围还可以用 in(小值大值)select prod_name,prod_price from productswhere vend_id in(1002,1003)order by prod_name;同义转换功能与 or 相当select prod_name,prod_price from productswhere vend_id 1002 or vend_id 1003order by prod_name;这里用in 和or 查询结果都一样image.pngin操作符的优势1) 在使用长的合法选项清单时IN操作符的语法更清楚且更直观。2) 在使用IN时计算的次序更容易管理(因为使用的操作符更少)。3) IN操作符一般比OR操作符清单执行更快。4) IN的最大优点是可以包含其他SELECT语句使得能够更动态地建立WHERE子句not 取反找出与条件列不匹配的行select prod_name,prod_pricefrom productswhere vend_id not in (1002,1003)order by prod_name;2. like:运用通配符进行过滤%任何字符出现任意次数 (....where [column] like a%):列 column 中以a开头的所有行select prod_id,prod_namefrom productswhere prod_name like jet%;image.png注意% 可以匹配尾空格不能匹配null值_:匹配任意单个字符select prod_id,prod_namefrom productswhere prod_name like _ ton anvil;通配符使用注意事项1)优先选择其他操作符2)使用时最好不要用在搜索模式的开始位置会使得搜索变慢。3)注意通配符放置的位置3. 复杂过滤正则表达式regexp:...where [column] regexp abc完全匹配select prod_name from productswhere prod_name regexp%1000order by prod_name;部分匹配. :任意一个字符select prod_name from productswhere prod_name regexp .000order by prod_name;image.png注意这里换成like是不输出结果的。select prod_name from productswhere prod_name regexp1000order by prod_name;为什么呢regexp vs like1)like 匹配整个列regex在列值内匹配。比如匹配1000like会在一列中查找字符为1000的值但是regexp在每一个值中找到含有字符1000的值2)like 必须和通配符结合使用否则不返回结果。或匹配(or)a|b—— 匹配 a 或者 b匹配多项中的一项[123]-匹配1或2或3匹配特殊字符前面加\匹配范围[1-9]select prod_namefrom productswhere prod_name regexp [1-8] tonorder by prod_name;其他匹配规则^ 文本的开始 $ 文本的结尾 [[:::]] 词的结尾