I am trying to select some records from a table using an array into the variable init_av_days but its not working out. init_av_days is to be committed to another table after this select query. How best do you suggest i do this? Answer init_av_days is to be committed to another table after this select query Best? Skip PL/SQL entirely, I’d
Tag: sql
number of appearances of an atribute before a date in a query
I have this table and what I need as an output is to have for each payment the number of payments that have been done with the same credit card. For example, for the first payment there would be 0 payments with the same credit card. for the second payment there would be 1 payment with the same credit card.
How to get Table field names at top of result array
Here is my Sample table: Here is My Query: Result for above query is: I need to get the field names in the first element of the array. Expected result array is: How can I modify the Query to get this result? Thanks in advance… Answer Display issues should generally be dealt with in application code, not SQL queries. If
How to aggregate with join
I am very new to SQL and I was wondering if someone could help me find the quantity on hand (dqty-sqty) for each iname? This is what I’ve been trying to do so far but the total quantity that I get is wrong: Thanks so much! Answer you need to take the sum of the delivered and sold items individually
How to output row count calculations in Oracle’s SQL*Plus
I am using SQL*Plus with Oracle 11.2 and I know how to output the count of rows adhering to some condition, e.g.: Also it is easy to output all rows in MY_TABLE: However, how can I output in SQL*Plus the ratio of the two counts, i.e. how can I do in SQL*Plus a calculation on the output from SQL commands?.
add not null column take values from other column
I have an existing table say, Items with Id | CreateDate (as DateTime) columns; want to add Year int not null, take the default year from the CreateDate column. The Year value will be futer updated …
Find turning points in rows with SQL or LINQ
Lest say I have the following data: Date Value 04.04.2019 | -1,7 05.04.2019 | -3,3 06.04.2019 | -4,4 07.04.2019 | -6,4 08.04.2019 | 5 11.04.2019 …
How to use different conditions depending on variable value. Pro C / SQL
I am quite new to pro c and wanted to know wether the below is possible. char car[11]; strcpy(car,””); /* default value*/ if this variable has a value it should be used within the sql below : So run …
SQL merge two tables – get only one row for each key value
I’m trying to run an SQL command on my database. I have two tables, one for users, another one for posts. I want to find last post of each user. I tried following: SELECT b.`username`, b.`id`, c.`…
JPA Batch inserts with non auto generated id
im triying to batch insert a few Million Entitys. The Batch insert kind of works, but my programm executes a few JDBC Statements in the background which i dont want. } my Repository: my Entity: my JPA Settings: The Batch Insert Does work, but if i try to Upload 100 Entitys i have 33 JDBC Statements which are checking the