Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This category lists all questions related to Oracle SQL database
Convert number of seconds to Hours:Minutes:Seconds format
Hi, SELECT TO_CHAR(SYSDATE,'SSSSS') FROM DUAL; -- will return like 54071SELECT TO_CHAR(TO_DATE(54071,'SSSSS'),'HH24:MI:SS') FROM DUAL;-- will RETURN like 15:01:11 It will help
Hi,
SELECT TO_CHAR(SYSDATE,’SSSSS’) FROM DUAL; — will return like 54071
SELECT TO_CHAR(TO_DATE(54071,’SSSSS’),’HH24:MI:SS’) FROM DUAL;– will RETURN like 15:01:11
It will help
See lessget number of days between two dates column in oracle sql?
Hi, Like this we can use: SELECT pol_fm_dt, pol_to_dt, ROUND(pol_to_dt - pol_fm_dt) FROM pgit_policy;
Hi, Like this we can use:
is there oracle function to remove spaces in the string ?
hi albert, try this : select replace('Oracle Forms 10G', chr(32), '') from dual; hope this help.
hi albert,
try this :
hope this help.
See lesshow to create dynamic tables ,columns, and datatype for each column in oracle ?
hello @Tiwari Sandeep what i meant is i want create table at run time like create table tablename (col1 varchar2(50), col2 number); actually we can do this by dynamic SQL but it's unfortunately not recommended by oracle because this will open a loophole for hackers by (SQL INJECTION) if you have anyRead more
hello @Tiwari Sandeep what i meant is i want create table at run time like
actually we can do this by dynamic SQL but it’s unfortunately not recommended by oracle because this will open a loophole for hackers by (SQL INJECTION) if you have any idea to avoid this will be very appreciated
thank you for your reply.
See lessHow to Insert data include symbol '&' into a table ?
it's very simple just using this : set define off insert into table values ('& yourvalues'); and then press 'F5' to execute the above commands. also from sqlplus you can use this : set define off
it’s very simple just using this :
and then press ‘F5’ to execute the above commands.
See lessalso from sqlplus you can use this :
set define off
How to create a column with AUTO_INCREMENT in Oracle?
You can create a sequence then call a before each row trigger on this table for ID value.
You can create a sequence then call a before each row trigger on this table for ID value.
See lesshow can I know reserved words in oracle ?
just execute this query to list all oracle reserved words select *from v$reserved_wordswhere reserved = 'Y' hope this helpful :) share with others to stretch our experiences
just execute this query to list all oracle reserved words
select *
from v$reserved_words
where reserved = 'Y'
hope this helpful 🙂
See lessshare with others to stretch our experiences
How can i Update a table by data in another table ?
This called correlated update you can find examples below UPDATE TABLE(<SELECT STATEMENT>) <alias1> SET <column_1> = ( SELECT <column_1> FROM <table_2> <alias2> WHERE <alias2.table_name> = <alias1.table_name>); in you sample : UPDATE table1 t1 Read more
This called correlated update you can find examples below
in you sample :
alternative way you can do this
and now the final example is
See lessHow to combine “LIKE” and “IN” condition in sql ?
There is no combination of LIKE & IN in SQL, but you can use REGEXP_LIKE condition it's similar LIKE condition, except REGEXP_LIKE performs regular expression matching instead of the simple pattern matching performed by LIKE. Also this condition evaluates strings using characters as defined by iRead more
There is no combination of LIKE & IN in SQL, but you can use REGEXP_LIKE condition it’s similar LIKE condition, except REGEXP_LIKE performs regular expression matching instead of the simple pattern matching performed by LIKE. Also this condition evaluates strings using characters as defined by input character set.
Example 1 :
First Name
Walker, Mr. Kenneth (Ken)
Example 2 :
FIRST_NAME
Steven
Stephen
Example 3 :
LAST_NAME
De Haan
Greene
Bloom
Feeney
What is the difference between varchar and varchar2 data type?
Currently VARCHAR behaves exactly the same as VARCHAR2. However, this type should not be used as it is reserved for future usage VARCHAR is reserved by Oracle to support distinction between NULL and empty string in future, as ANSI standard prescribes. VARCHAR2 does not distinguish between a NULL andRead more
Currently VARCHAR behaves exactly the same as VARCHAR2. However, this type should not be used as it is reserved for future usage
See lessVARCHAR
is reserved byOracle
to support distinction betweenNULL
and empty string in future, asANSI
standard prescribes.VARCHAR2
does not distinguish between aNULL
and empty string, and never will.If you rely on empty string and
NULL
being the same thing, you should useVARCHAR2