Thursday, August 1, 2013

SQL Queries

Not like qurery

select Colum1 from tablename where Colum1 = 'ramprasad' and Colum2 not like '%Prasad%'
 
Append two columns data

select (Colum1 ||':' ||Colum2 ) from TableName
Ex: Colum1 = Ram and Colum2 =prasad

Result:Ram:prasad

  • To Know the time stamp of the Oracle  Database.
                select SYSTIMESTAMP from dual;


  •  To Know the time stamp of the Database.


               select SYSTIMESTAMP from dual


  • Query Which displays all the records expect the records in other table

select row1 from Table1 where row1  NOT IN (select row1  Table2  where row2= 'Test');
Here row1 present in two tables(Table1 & Table2).Query will  show the all the records in Table1 except the record present in Table2







14 comments: