Overblog All blogs Top blogs Jobs, Education & Studies
Follow this blog Administration + Create my blog
MENU
Advertising

SQL SERVER PROCEDURES

Customers Table Contracts Table Syntax The syntax to create a stored procedure in SQL Server (Transact-SQL) is: CREATE { PROCEDURE | PROC } [schema_name.]procedure_name [ @parameter [type_schema_name.] datatype [ VARYING ] [ = default ] [ OUT | OUTPUT...

Read more

Advertising

SQL SERVERDATA TYPES

SQL SERVERDATA TYPES The following is a list of datatypes available in SQL Server (Transact-SQL), which includes string, numeric, and date/time datatypes. STRING DATATYPES The following are the String Datatypes in SQL Server (Transact-SQL): NUMERIC DATATYPES...

Read more

SQL SERVER FUNCTIONS

SQL SERVER FUNCTIONS ABS ASCII AVG CASE CAST CEILING CHAR CHARINDEX COALESCE CONCAT Concat with + CONVERT COUNT CURRENT_TIMESTAMP CURRENT_USER DATALENGTH DATEADD DATEDIFF DATENAME DATEPART DAY FLOOR GETDATE GETUTCDATE ISDATE ISNULL ISNUMERIC LEFT LEN...

Read more

PRAGMA RESTRICT_REFEREN

PRAGMA RESTRICT_REFERENCES Oracle PRAGMA RESTRICT_REFERENCES uses to control the side effects of PL/SQL Subprograms. Every PL/SQL Subprograms must follow some rules in terms of transaction control and security. What is PRAGMA PRAGMA is an instruction...

Read more

Advertising

LEAD function Oracle

LEAD function Oracle by sqlandplsql LEAD function used to find next row value within the same table. It is an example of analytical function. Syntax :- LEAD(column, context, default) over partition clause context – number of rows to go forward. Default...

Read more

LAG function Oracle

LAG function Oracle by sqlandplsql LAG function used to find previous row value within the same table. It is an example of analytical function. Syntax :- LAG(column, context, default) over partition clause context – number of rows to go backward. Default...

Read more

analytical functions in Oracle.

FIRST_VALUE and LAST_VALUE analytical functions by sqlandplsql Both FIRST_VALUE and LAST_VALUE are analytical functions in Oracle. FIRST_VALUE It is used to find the first value from a ordered set of values. Syntax :- 1) FIRST_VALUE(column) over(partition...

Read more

DENSE_RANK

DENSE_RANK is an Analytical function as well as Aggregate function in Oracle. It returns the rank of the row within the group and it is dense. Syntax (Aggregate function): dense_rank(expression1,expression2,…) WITHIN GROUP (ORDER BY expression1,expression2…)...

Read more

Advertising

Nth highest salary

Nth highest salary 1) Find highest salary/salaries using DENSE_RANK() function select * from (select empno,salary,dense_rank() over(order by salary desc) as rk from emp) where rk = 1; EMPNO SALARY RK ———- ———- ———- 10 12000 1 2) Find 2nd highest salary/salaries...

Read more

Translate function Oracle

Translate function Oracle Posted on September 30, 2012 by sqlandplsql TRANSLATE function replaces a string with another set of characters.TRANSLATE replace characters in sequential order. Syntax TRANSLATE(string, from_string, to_string) Example 1:- SQL>...

Read more

<< < 10 20 30 31 32 33 34 35 36 37 > >>