I have three tables. inspectionreport +———-+—————–+——+ | ReportID | InspectionID_id | Date | +———-+—————–+——+ inspectionreport has ReportID PK, …
Tag: sql
Oracle – Is there a way to rewrite my query to lower the number of times I’m querying a table
My modified query: SELECT SLDOCO AS ORDER_NO, SLDCTO AS ORDER_TYPE, SLAN8 AS CUSTOMER_NO, ABALPH AS CUSTOMER_NAME, SLLTTR AS LAST_STATUS, SLNXTR AS …
How to set large string as param without getting ORA-01460: unimplemented or unreasonable conversion error?
In spring-boot using namedParameterJdbcTemplate (Oracle db version 12 and odbc8 driver 12.2) I am getting the following error while executing a SELECT query bound with a parameter larger than 4000 …
Join Two table result comes as Blank in MySql
my problem is when i going to join two table altogather i ran into the problem with one table has data another table has no data but i want to display if data has one table it should display with …
Default Value in a column when insert a new row
I have the table Photographies with the columns: Name, Author, Date, Updated date. I would like to set Update date as default current_date when a new record is inserted or when a record is updated. …
Count rows according to 2 column with Group By
I have a database table of 3 columns RecordID Deleted CardHolderID 1963 1 9 4601 1 9 6996 0 9 1532 1 11 1529 0 20 I want an sql …
SQL Oracle – Replace function in Where Clause
I want to use the REPLACE function in the Where clause to replace a character that I put into a input box. For example if I input R123;R321 I want it to change my input to R123′,’R321. Example of my …
How do I use both a SELECT query and RETURNING inside the same SQLPLUS INSERT INTO statement
I’m working on this project I’m using sqlplus and I’m making this procedure in PL/SQL: I just get the error: SQL command not ended properly. I can’t find any information online about how to properly do this. I tried to have t_order_no as a table. I tried having it RETURNING BULK COLLEC…
finding sum of salary from employee table
I’m having the data in data base like in the below. Emp_id Ename Sal 11 AAA 10 22 BBB 20 33 CCC 30 44 DDD 60 Then i want to populate a new column as in the below. …
SQL query to select previous 14 months where add amount ‘0’ if any month is missing
I have create this query to select the date, amount for previous 14 months, In this case the month is missing if no record is present for that month, Please suggest me a solution to add zero and month …