Skip to content

Tag: oracle

Formatting bigdecimals sql oracle

To have a readable big numbers under oracle and to facilatet the reading, I’m looking for a way to add blank space to obtain something like that: 213537592384.236 ===> 213 537 592 384.236 The problem that I have big numbers like above. Answer Spaces are a curious separator, and not directly supported…

ORACLE ALIAS in WHERE Clause Subquery

Here is my SQL code. I used subquery and labeled it, but when I call column from that subquery, it shows that as invalid identifier. error as per below Please help me to sort out this issue. I need to call subquery’s columns also in my final SQL view. Answer You can only use colums that are in your FROM

Flattening a hierarchial data set in Oracle

I have a set of data as shown below I need to flatten this data as below: And so on. I can have up to 30 parent child relationship I used the connect by and sys_connect_by_path as follows The result set is too large. There are other trees in this table and I don’t think it just looks at the

Select EMP with max SAL from each DEPT

I´m having a bad time with a SQL query. I´m using oracle default tables: ‘EMP’ TABLE http://imageshack.us/photo/my-images/850/sinttuloxps.png/ AND ‘DEPT’ TABLE http://imageshack.us/photo/my-images/19/assayp.png/ I wan´t to get the employee with the highest salary in each department. I´…

Generating dates between two dates

I need to generate all dates between two given dates. This works fine as long as there is just one date range. However, if I have multiple date ranges, this solution doesn’t work. I have searched here …

Oracle SQL. How to execute query one by one

Could you help me, how can I execute query one by one in Oracle SQL Developer? When there’s one query system works correctly. But when I write 2 or more and press “ctrl” + “enter”, System marks out all queries and trying to execute all of them. Answer Separate each query by semi-…