select * from tab where TABTYPE='VIEW';
select * from tab where TABTYPE!='VIEW';
select * from tab where TABTYPE<>'VIEW';
select * from tab where length(TABTYPE)>4;
select * from tab where length(TABTYPE)<4;
select tabtype from tab where length(TABTYPE)<=4;
select tabtype, count(tabtype) from tab group by tabtype;
select * from t102;
select col1, count(col1) from t102 group by col1;
--find dulicate records
select col1, count(col1) from t102 group by col1 having count(col1)>1;
select col1, count(col1) from t102 where col1 not in (1003,1004,1005) group by col1 ;
select col1, count(col1) from t102 where col1 in (1003,1004,1005) group by col1 ;
--Find all col from t102 in which character start from p
select * from t102 where col2 like 'p%';
--Find all col from t102 in which character last on s
select * from t102 where col2 like '%s';
--Find all col from t102 in which character a available any where in text
select * from t102 where col2 like '%a%';
--Find all col from t102 in which character a available on second position from start
select * from t102 where col2 like '_a%';
--Find all col from t102 in which character a available on second last position in text
select * from t102 where col2 like '%a_';
--between example
select * from employees
where salary between 5000 and 10000;
--between and 'and' example
select * from employees
where salary between 5000 and 10000 and job_id='ST_MAN';
--between and 'or' example
select * from employees
where salary between 5000 and 10000 or job_id='ST_MAN';
0 comments:
Post a Comment