This is the problem: https://www.hackerrank.com/challenges/what-type-of-triangle/problem I’ve tried this solution: The above solution does not work. Whereas the solution given below works I feel both solutions are the same except swapping the side of the operands while I also appropriately changed the o…
Tag: oracle
ORA-02290: check constraint violated
I keep getting the message “ORA-02290: check constraint violated” whenever I try to insert values into my table. Here’s the code for the table STORE: And here’s the INSERT statements I am trying to accomplish: It has created the 4th, 6th, and 7th values, but not the rest. What is going…
limit column char trigger plsql
I’m starting to learn PLSQL and created a very very simple table, I’m trying to get familiar with functions and triggers. My table: Now to the question, I want to limit before insert or update new row (biuefer) so that the first name must be 8 characters, not less, not more. If you try to insert a…
ALTER TABLE ADD field getting ORA-00942 error
I run the following command: and I get the following error message: SQL Error: ORA-00942: table or view does not exist 00942. 00000 – “table or view does not exist” *Cause: *Action: When I select * from users, I get records. Can someone tell me what I am doing wrong here? Answer This was a p…
TO_CHAR from Date data type output difference
Not sure why I see this big difference when using to_char function Answer You are using the format of month MM instead of Minutes MI ,Please use the below
Mysql – Finding a record that satisfies 2 exact dates
Fairly new to mysql & the stack overflow community. – I have a question that’s been bugging me. I’m trying to return the results of individuals that have taken out a book on 2 specific dates. This is my effort so far; I’m not sure why I’m not getting any results – When …
How to create an Oracle Procedure which includes a Subquery for an SQL Insert Into clause?
I have a problem to declare an Database Procedure, which includes an SQL Insert Into Statement with a subquery. I use an Oracle database. I get an errormessage, that tells me the From keyword was not found where expected (ORA-00923). Could somebody explain me, how I create this syntax error in the following e…
How to use listagg properly with case statements
I am trying to use listagg but I’m getting the wrong output. Normally, I would use each case statement separately, but then how would I use listagg? Table A: Table B: Desired Output: My attempted (wrong) code: Answer Here’s one option, which uses multiple self-joins. lines #1 – 14 represent …
Group rows into range while also showing gap
I am in need of a database select query solution for transforming a series of breakdown details into a summarized version of it, possibly in a view. Consider the table below. It has a composite primary key of (PK_1, PK_2, PK_3, and SEQUENCE_NO). Only including all records with the STATUS_CODE of “Y̶…
Display output is columns based on filter criteria
I am trying to display data is columns/subcolumns based on certain filter criteria using case when statement but not getting required output. data: based on my current case statement, here is how my output looks: I want to display the following format, bonus if I can get the subtotal/totals: I also need Subto…