Skip to content

Tag: sql

DELETE By Procedure With String Input – Oracle

I am writing a procedure to delete some records of z_names table by IDs from the input as string (and I need to seprate them by special character (comma ,)). Sample Input: ‘1,4’ z_names table: ID NAME 1 jim 2 john 3 jack 4 alex After running this procedure, the record with ID 1 and 4 (jim and alex…

how can i loop insert query?

I have a problem like this: I need to optimize the application, with db (postgreSQL), the table looks like this: I have more than a thousand such voters, and I need to put all of them in the database, but among them there are several duplicates that could vote several times (from 2 to infinity), and I need to…

How to print a variable in SQL stored procedure?

I want to print the a variable in the above code. But the code returns How to fix this? Answer You can use an OUT variable ✓ ✓ | answer | | :—– | | yes | db<>fiddle here* Or simply don_’t use INTO or := | count(amount) | | ————: | | 2 | ✓ | answer | |

How to define INNER JOIN in SQL

I have a problem how to define INNER JOIN in SQL. The problem is that I have a table Names with columns ID and Name. The other table has column PersonID. Sometimes value in column PersonID is 0, and in Names table there is no row with a column value of 0. I have created a view, and I am