Skip to content
Advertisement

Tag: plsql

Use select inside ‘filename’ property of utl_file.fopen

I have a procedure that extracts data from a view and stores it on disc in CSV format. I’d like a name of the file to contain the most recent timestamp from table MY_TIMESTAMPS. For now it looks like this: The part with (select to_char(max(EVENT_TS)) from MY_TIMESTAMPS) throws an error. How can I set this dynamic filename property? Maybe write

subtraction of 2 select statements

I have a simple table: Neighbourhood Some countries have the same neighborhood name. All I want is the total minus the distinct. but I have a problem with the operator; Here is what I am doing. Answer So you want: I might suggest a further breakdown: This shows the frequency of duplication along with example value of neighbourhood.

Get range of columns with specific value in Oracle

I wasn’t sure how to title this question, but I’ve got an Oracle table that has a column for each day of the week. These represent the days a business is open. The values in these columns is either ‘Y’ or ‘N’. This is how the table was setup years ago and I am unable to change it. I need

Using COALESCE correctly in WHERE clause

Can someone explain why coalesce doesn’t work in the where clause given the following conditions below? How do we use coalesce correctly in this case without changing the below coalesce conditions and only for spoiled = Y? Table Fruit: Query: Using the query above will not return anything. Desired output should be grapes. Desired Output: Answer We can use ROW_NUMBER

Advertisement