Oracle SQL Developer: Failure – Test failed: The Network Adapter could not establish the connection?

I am answering this for the benefit of future community users. There were multiple issues. If you encounter this problem, I suggest you look for the following: Make sure your tnsnames.ora is complete and has the databases you wish to connect to Make sure you can tnsping the server you wish to connect to On … Read more

What is the Oracle equivalent of SQL Server’s IsNull() function?

coalesce is supported in both Oracle and SQL Server and serves essentially the same function as nvl and isnull. (There are some important differences, coalesce can take an arbitrary number of arguments, and returns the first non-null one. The return type for isnull matches the type of the first argument, that is not true for coalesce, at least on SQL Server.)

Oracle SQL query for Date format

to_date() returns a date at 00:00:00, so you need to “remove” the minutes from the date you are comparing to: You probably want to create an index on trunc(es_date) if that is something you are doing on a regular basis. The literal ’27-APR-12′ can fail very easily if the default date format is changed to anything different. So make sure … Read more

Oracle “Partition By” Keyword

The PARTITION BY clause sets the range of records that will be used for each “GROUP” within the OVER clause. In your example SQL, DEPT_COUNT will return the number of employees within that department for every employee record. (It is as if you’re de-nomalising the emp table; you still return every record in the emp table.) If there was another column (e.g., state) then you could … Read more