Monday, October 24, 2016

Equivalent of INSTR of Oracle in SQL Server

Hi all...

There is an equivalent of INSTR of Oracle is,


As there is extra parameter in oracle as next occurrence .. it is not available in SQL Server..


ORACLE
SQL SERVER
Select INSTR('TEST_A,TEST_B','_') from dual
Select CHARINDEX('_','TEST_A,TEST_B') 

Equivalent of Dual in Oracle in SQL Server

Hi all here is the conversion for Dual:

 there is no concept called dual in SQL Server..

OracleSQL Server
select 2*3 from dualselect 2*3

Sunday, May 22, 2016

Multiplication Table in Oracle...

Hi Guys ,

Today we will discuss about the Multiplication with the help of Level --- Connect by clauses.

Query:

select :n Multiplier,level Multiplicand  , :n*(level) Product from dual connect by level <=10;


 -----> In this we can able to give any number's product.

Output:

Multiplier Multiplicand Product
3 1 3
3 2 6
3 3 9
3 4 12
3 5 15
3 6 18
3 7 21
3 8 24
3 9 27
3 10 30

Wednesday, March 2, 2016

NTILE In Oracle

Hi friends today we will discuss about NTILE in Oracle:

Syntax:

   SELECT NTILE(NUMBER) OVER (ORDER BY <COLUMN>) FROM TABLE;

Example:

  SELECT ename, sal, NTILE(2) OVER (ORDER BY sal asc) AS quartile
  FROM EMP
  ORDER BY ename, sal, quartile;

o/p:

 
empname sal quartile
11raj 5000 2
ADAMS 1100 1
ALLEN 1600 2
BLAKE 2850 2
CLARK 2450 2
FORD 3000 2
JAMES 950 1
JONES 2975 2
MARTIN 1250 1
MILLER 1300 1
SCOTT 3000 2
SMITH 800 1
TURNER 1500 1
WARD 1250 1

Power Function In Oracle

Hi friends today we will discuss about power function in oracle:
The syntax:
select   power(number,number) from dual;

example:

 select power(3,2) from dual;

o/p:
9

Thank u

Read data from csv in R Programming

Read a data set from csv file.. x <- read.csv(file.choose(),header=TRUE) here x is the R data set vaiable.