Skip to content

Tag: sql

Column merge using sum in case Oracle APEX

I need help How can I merge the column into a single column, here is my code, is this method is correct. I want to get the count of the selected row in the table for the columns. Can you guys help me I’m a beginner at SQL. Thank you in advance Answer If you want just one row in

Query items from a history table

I have a “library” history table (Excel like) to see where a book was or is. id date book action client 1 2020-12-01 1 toClient 1 2 2020-12-02 1 returned 1 3 2020-12-03 1 toClient 2 4 2020-12-04 2 toClient 2 5 2020-12-05 3 toClient 1 6 2020-12-06 3 returned 1 7 2020-12-07 2 returned 2 8 2020-12-08…

joining same table multiple times in Oracle

Hi I am tuning one legacy code. we have below 2 tables in a big query. I have seen in from clause first table has been used thrice and it has been outer joined with same column with same table. Can above 3 lines be handled using fnd_currencies table only once. is there any smarter way to do that? Answer

SELECT from a table partition by order and status

So I have the following Searches table: The status is a combination of ClosedOn and ClosedByUserID: Pending: If ClosedOn and ClosedByUserId are null Outdated: If ClosedOn is not null and ClosedByUserID is null Closed: If ClosedOn is not null and ClosedBYUserID is not null I am trying to select all records and…