SQL Syntax - Some Useful Keywords
2014-04-11 01:07
232 查看
1. SELECT TOP Clause
--TOP used to specify the number of records to return,SQL SERVER
SELECT TOP number|percent colName
FROM tableName;
2. Like pattern
% A substitue for zero or more characters
_ A substitue for a single character
[charlist] Sets and ranges of characters to match
[^charlist] or [!charlist] Matches only a character NOT specified within the brackets
3. IN OPERATOR
SELECT colName
FROM tablename
WHERE colname IN(val1, val2, val3,...)
4. Between
SELECT colName
FROM tablename
WEHRE colName (NOT)BETWEEN val1 AND val2;
5. SQL Aliases
--SQL Alias Syntax for columns
SELECT colName AS aliasName
FROM tablename
--TOP used to specify the number of records to return,SQL SERVER
SELECT TOP number|percent colName
FROM tableName;
--MySQL SELECT colName FROM tableName LIMIT number;
2. Like pattern
% A substitue for zero or more characters
_ A substitue for a single character
[charlist] Sets and ranges of characters to match
[^charlist] or [!charlist] Matches only a character NOT specified within the brackets
3. IN OPERATOR
SELECT colName
FROM tablename
WHERE colname IN(val1, val2, val3,...)
4. Between
SELECT colName
FROM tablename
WEHRE colName (NOT)BETWEEN val1 AND val2;
5. SQL Aliases
--SQL Alias Syntax for columns
SELECT colName AS aliasName
FROM tablename
--SQL ALias Syntax for Tables SELECT colname FROM TableName AS alias_name;
相关文章推荐
- Postgre: Some useful command of Postgre
- some useful link for inner blog
- Some useful TextBox Validations
- Postgre: Some useful command of Postgre
- Some Useful Regex expressions
- Some weird but useful C code
- Some useful DQL tips
- 转载一个老外的编译错误hope useful to some one really need it
- some useful softwares in linux
- Postgre: Some useful command of Postgre
- Some useful tips about sox rec
- Some useful sentences and words
- Some useful vba macros
- some useful add-ins for visual studio
- some useful technology english
- Some useful websites
- c# - some confused modifier keywords
- Shell - Some useful tips to work with Shell
- Some useful links
- some useful website of video knownledge