First, conditional screening
1. Digital filter: sql = "SELECT * from [sheet1$] Where sales price > 100"
2. Character condition: sql = "SELECT * from [sheet1$] Where Object name = ' Fender '"
3. Date condition: sql = "SELECT * from [sheet1$] Where Object name = ' Fender '"
4, interval conditions: sql = "SELECT * from [sheet1$] Where out of the library date between #2005 -1-4# and #2005 -1-10#"
5. Multiple conditions: Connect with And,or
' sql = ' select * from [sheet1$] Where out of the library date between #2005 -1-4# and #2005 -1-10# and sales price >100 "
6, fuzzy conditions:% of any number of characters, _ (underline) represents a single placeholder
' sql = ' select * from [sheet1$] Where item name like '% armrest% '
7. Insert Variable query:
' sr = ' fender '
' sql = ' select * from [sheet1$] Where Object name = ' & sr & ' '
8, in the string group:
' sql = ' select * from [sheet1$] Where object name in (' Garment ', ' armrest ') '
9, Borrow function optimization:
' sql = ' select * from [sheet1$] Where left (item code, 3) = ' 028 ' "
Second, specify the filter
1. Filter all fields: * represents all fields
' sql = ' select * from Chuku '
2. Filter the specified field: List all fields to be displayed before from, if you want to skip using the "" "
' sql = ' select ' "'," "", "" "," "," "," "," ", spec, unit from Chuku"
3, Filter not duplicate: Distinct field name filter for records that are not duplicates
' sql = ' select Distinct ' "", Item code from Chuku
4, Filter by percentage: Top N percent can display the previous N records
' sql = ' select top Percent * chuku '
' The filtered fields are further processed and formatted with functions
' sql = ' Select Id,format (Out of date, "" Yyyy-mm-dd ") from Chuku"
5, Sort: desc Descending, ASC ascending
' sql = ' select * from Chuku ORDER by out date ASC, sales unit Price desc "
' sql =" SELECT top * to Chuku ORDER by out date ASC, sales ASP des C "' Filter the number of sales before 10 ()
Third, grouped display
Group by can be combined with functions to sum up, the group to find the maximum value and so on.
' sql = Select ' "", "" "" "," "" "" "" "", "" "" ", sum (out of stock) from Chuku Group by item code"
Display grouped records by condition
"sql = select" "" "" "" "", "" "" "," "" "" "" "", "" "", sum (out of stock) from Chuku Group by item code having sum (out of stock) >=3 "
The above is a small set to introduce the MySQL database of the Select Usage Summary, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!