平時少用到的sql query

2021-05-23 13:44:01 字數 370 閱讀 5635

查詢第三個字元是'i'的結果:

select col_1 from tab_1 where col_1 like '__i%';

查詢在1到7之間的結果:

select col_1 from tab_1 where col_1 between 1 and 7;

在where中使用select語句:

select col_1 from tab_1 where col_2 = (select count(*) from tab_2);

組合表查詢:

select tab_1.col_1, tab_2.col_1, col_2 from tab_1, tab_2 where tab_1.col_1 = tab_2.col_1;

平時用到的Linux命令

備份資料庫 mysqldump uroot root使用者名稱 p123 123密碼 phpbb db backup 選擇備份的資料庫 usr backups mysql db backup2008 1 6.sql 備份路徑以及生成的檔名 tip u p是格式 還原資料庫 mysql uroot p...

平時自己專案中用到的CSS

outline 當選中input元素的時候會出現狀態線,outline設定成none就沒了 input contentditable 設定元素內的文字是否可編輯 可編輯user select 禁止使用者選中文字 webkit user select none moz user select none...

sql query執行的順序

第一,from,選擇或者join多個表得到基礎資料表,所以,聯結是第一步要執行的操作,它在獲取最基礎的資料表 第二,where,過濾掉基礎資料表中不符合條件的行,得到後續操作的資料表 第三,group by,對基礎資料表進行聚合,如果還有where的話,就在where過濾後的表的基礎上進行操作 第四...