Skip to content
Advertisement

Tag: oracle

In sql how do you print only the most occuring

This actually tells us which person made the most purchases. But how can i print only the top row and not have all the other rows below? Answer You want to fetch the highest ranked row(s) of your intermediate result. If you want to keep your query as is and only add the appropriate clause, use FETCH and a modified

How to print pattern output in Oracle’s SQL

I have a table with below data Table : emp name A B C D Expected Output : names A AB ABC ABCD I only know how to print data in horizontal form Not sure how to cut the horizontal and get expected output Answer You can use a hierarchical query: Which, for the sample data: Outputs: NAMES A AB

how to retrive data from VARRAY and filter it

i have to retrieve specific data from Varray for example i want to retrieve the name where VARRAY includes AC1 i tried select * from exprement where seat=’AC1′; Answer You can use: or As an aside, if you defined seat as a nested table (rather than a VARRAY) then you could use the MEMBER OF operator: But that doesn’t work

Selecting last record in plsql

Hello I need to select last record in a table(bill_account_billcycle). After finding it I need to take bill_date column date from last record and need implement inside my cursors’ query. I read rownum max etc but couldnt succeed to implement. I am open to advices. I am going to add a screenshoot of one bill_account record to there and my

SQL – How to print calculated datetime result

If a.modified_datetime is ‘2021/10/01 13:00:00’ and b.modified_datetime is ‘2021/10/01 12:30:00’, the result of this query would be: However, I run this query via sqlplus, it returns What’s wrong with this query, or need to set some options to sqlplus? Answer it is stored in a date column As @a_horse_with_no_name pointed out in a comment, calling to_date() on a value that

Advertisement