GROUP BY – SQL Server Syntax Example: GROUP BY – T-SQL Example

GROUP BY – SQL Server Syntax Example: GROUP BY – T-SQL Example Purpose: – Illustrates the SQL Server syntax for the GROUP BY. SYNTAX: SELECT [ ALL | DISTINCT ] [TOP ( expression ) [PERCENT] [ WITH TIES ] ] [ INTO new_table ] [ FROM { table_source } [ ,…n ] ] [ WHERE select_condition ] [ GROUP BY ] [ HAVING search_condition ] [ ORDER BY order_expression [ ASC | DESC ] PURPOSE: Groups rows by... [Read More...]

EXISTS – SQL Server Syntax Example: EXISTS – T-SQL Example

EXISTS – SQL Server Syntax Example: EXISTS – T-SQL Example Purpose: – Illustrates the SQL Server syntax for the EXISTS. SYNTAX: SELECT [ ALL | DISTINCT ] [TOP ( expression ) [PERCENT] [ WITH TIES ] ] [ INTO new_table ] [ FROM { table_source } [ ,…n ] ] [ WHERE EXISTS subquery ] [ GROUP BY ] [ HAVING search_condition ] [ ORDER BY order_expression [ ASC | DESC ] PURPOSE: EXISTS returns a boolean... [Read More...]

DISTINCT – SQL Server Syntax Example: DISTINCT – T-SQL Example

DISTINCT – SQL Server Syntax Example: DISTINCT – T-SQL Example Purpose: – Illustrates the SQL Server syntax for the DISTINCT. SYNTAX: SELECT [ ALL | DISTINCT ] [TOP ( expression ) [PERCENT] [ WITH TIES ] ] [ INTO new_table ] [ FROM { table_source } [ ,…n ] ] [ WHERE search_condition AND search_condition ] [ GROUP BY ] [ HAVING search_condition ] [ ORDER BY order_expression [ ASC | DESC ] PURPOSE:... [Read More...]

DESC – SQL Server Syntax Example: DESC – T-SQL Example

DESC – SQL Server Syntax Example: DESC – T-SQL Example Purpose: – Illustrates the SQL Server syntax for the DESC. SYNTAX: SELECT [ ALL | DISTINCT ] [TOP ( expression ) [PERCENT] [ WITH TIES ] ] column1 AS displayname1, displayname2 = column_name2, column_name3 displayname3 [ INTO new_table ] [ FROM { table_source } [ ,…n ] ] [ WHERE search_condition AND search_condition ] [ GROUP BY ] [ HAVING... [Read More...]

Date Calculation – SQL Server Syntax Example: Date Calculation – T-SQL Example

Date Calculation – SQL Server Syntax Example: Date Calculation – T-SQL Example Purpose: – Illustrates the SQL Server syntax for the Date Calculation. SYNTAX:DATEADD (datepart , number, date ) – Returns a specified date with the specified number interval (signed integer) added to a specified datepart of that date. * User-defined variables are valid for number and date can be an expression, column expression, user-defined variable,... [Read More...]

Column Alias – SQL Server Syntax Example: Column Alias – T-SQL Example

Column Alias – SQL Server Syntax Example: Column Alias – T-SQL Example Purpose: – Illustrates the SQL Server syntax for the column alias options. SYNTAX: SELECT [ ALL | DISTINCT ] [TOP ( expression ) [PERCENT] [ WITH TIES ] ] column1 AS displayname1, displayname2 = column_name2, column_name3 displayname3 [ INTO new_table ] [ FROM { table_source } [ ,…n ] ] [ WHERE search_condition AND search_condition... [Read More...]

SELECT CASE – SQL Server Syntax Example: SELECT CASE – T-SQL Example

SELECT CASE – SQL Server Syntax Example: SELECT CASE – T-SQL Example Purpose: – Illustrates the SQL Server syntax for the SELECT CASE CLAUSE . SYNTAX: Simple CASE expression: CASE input_expression WHEN when_expression THEN result_expression [ …n ] [ ELSE else_result_expression ] END Searched CASE expression: CASE WHEN Boolean_expression THEN result_expression... [Read More...]

Bitwise – SQL Server Syntax Example: Bitwise – T-SQL Example

Bitwise – SQL Server Syntax Example: Bitwise – T-SQL Example Purpose: – Illustrates the SQL Server syntax for the Bitwise operator . Syntax: operand1 bitwiseoperator operand2 – You can and (&), or(|), exclusively or (^) bits between two columns. The operands for bitwise operators can be any one of the data types of the integer or binary string data type categories (except for the image data type), except that both... [Read More...]

BETWEEN AND – SQL Server Syntax Example: BETWEEN AND – T-SQL Example

BETWEEN AND – SQL Server Syntax Example: BETWEEN AND – T-SQL Example Purpose: – Illustrates the SQL Server syntax for the BETWEEN AND . Syntax: SELECT [ ALL | DISTINCT ] [TOP ( expression ) [PERCENT] [ WITH TIES ] ] select_list [ INTO new_table ] [ FROM { table_source } [ ,…n ] ] [ WHERE column1 BETWEEN lowerbound AND upperbound ] [ GROUP BY ] [ HAVING search_condition ] – AS allows... [Read More...]

Column AS Alias SQL Server Syntax Example: Column AS T-SQL Example

SELECT AS SQL Server Syntax Example: SELECT AS T-SQL Example Purpose: – Illustrates the SQL Server syntax for the SELECT AS . Syntax: SELECT [ ALL | DISTINCT ] [TOP ( expression ) [PERCENT] [ WITH TIES ] ] column1 AS displayname1, column2 AS displayname2 [ INTO new_table ] [ FROM { table_source } [ ,…n ] ] [ WHERE search_condition AND search_condition ] [ GROUP BY ] [ HAVING search_condition ] –... [Read More...]

SELECT ALL SQL Server Syntax Example: SELECT ALL argument T-SQL Example

SELECT ALL SQL Server Syntax Example: SELECT ALL argument T-SQL Example Purpose: – Illustrates the SQL Server syntax for the SELECT all argument. Syntax: SELECT [ ALL | DISTINCT ] [TOP ( expression ) [PERCENT] [ WITH TIES ] ] select_list [ INTO new_table ] [ FROM { table_source } [ ,…n ] ] [ WHERE search_condition ] [ GROUP BY ] [ HAVING search_condition ] – ALL indicates that duplicates are included... [Read More...]

« Previous PageNext Page »