Skip to content
Advertisement

Tag: oracle11g

Inserting data into table with select

i`m trying to do something…. I have to insert some data in to a table but….. So here is where I end up… any suggestion… Answer You cannot refer to an alias in the SELECT or WHERE clauses of a sub-query where it is defined. Generate the data in a sub-query (or a sub-query factoring clause) and then refer to

Searching for a string in a column

I need to show the results from this column where Product_name column contains ‘Documentation’ or ‘documentation’ in a result. The query must return a result regardless of whether the word is in lowercase or uppercase https://i.stack.imgur.com/bjLuY.png I found this solution, any suggestions Answer

Compare two VAT numbers

I`m trying to list only the vat numbers which look like DDDDDDDDDLLDDDD else i have to list NULL https://i.stack.imgur.com/4PYR8.png Pretty sure that I`m close but still missing something 🙁 Answer You can use the regular expression ^d{9}[A-Z]{2}d{4}$ to match the start-of-the-string, then any 9 digits, then any 2 upper-case letters, then any 4 digits and, finally, the end-of-the-string: If you

Get first row that is null in Oracle DB table

I have the following table rownum ID date owner 1 1 09/01/2022 null 2 1 09/02/2022 null 3 1 09/03/2022 Joe 4 1 09/04/2022 null 5 1 09/05/2022 Jack 6 2 09/01/2022 null 7 2 09/02/2022 John 8 2 09/02/2022 John 9 2 09/02/2022 John For every ID, I want to select the first occurrence of null that eventually results

ORA-00937: not a single-group group function Workaround

This is my query which produces this error: ORA-00937: not a single-group group function Expected result for the last column – first order of every customer: I know that I have to use GROUP BY clause to handle this error, but it seems rather inappropriate to group by all the other columns.. I know that this is a limitation in

Not able to create a matrix in PL/SQL using nested tables

I was trying to create a matrix in PL/SQL using nested tables as such: firstly, I create a table type that is able to store varchars (that in my case is name lista_principala) secondly, using the previously declare table type lista_principala I try to create a table type that contains items of type lista_principala. I don’t think that I’m wrong

Partial Group Filter

Oracle 11g How can I get ALL pet_owners of FURRRY and SCALY and only earthworms and slugs ? Answer You want either of the two conditions to be met, so you need OR:

Advertisement