About Me

well............. i m very simple guy who loves>>>animation>>>>>>photograph--------exploging new things********** IF U WANNA KNW MORE ABUT ME >>>>>>>>>>> JUS CALL ME ......... +919988487165 WAITING 4 UR CALL

Wednesday, October 10, 2007

OTHER TOPICS

Range searching

SQL> Select * from t1 where sal not between 300 and 500;

Distinct
Syntax:
SELECT DISTINCT column_name(s) FROM tablename;
If you need to find the unique departments and salaries from EMP table then, issue the following query:
SQL> SELECT DISTINCT deptno, sal FROM emp;


Pattern matching

In order to select rows that match a particular character pattern we use the LIKE operator. This character matching operation is called as wildcard search. The following symbols are used for matching the pattern
% (percentage) This symbol represents any sequence of zero or more characters . __ (underscore) this symbol is used for any single character search. The % and _ symbols can be used in any combination with literal characters.


Pattern matching symbol

%(percentage):- represents any sequence of zero or more characters.
_ (underscore):- it is used for any single character search.




List th
e employee names and empno whose names start with J.
SQL> select ename, empno from emp where ename like ‘J%’;
List the employee names whose names are of six characters length.
SQL>select ename from emp where ename like ‘_ _ _ _ _ _ ‘;
. List the employee names whose names end with ‘H’.
SQL>select ename from emp where ename like ‘%H’;

Truncating tables
It works same as delete function.
Syntax:
Truncate table tablename;


No comments: