Category "sql"

Append characters to a string in multiple rows in Oracle SQL

I'm trying to update a single column in multiple rows by appending the string '999': UPDATE integration.ol_orders SET order_id = ((SELECT order_id

Correct way to use LIKE '%{$var}%' with prepared statements?

This does not work $sql = 'SELECT * FROM `users` WHERE username LIKE \'%{?}%\' '; Warning: mysqli_stmt::bind_param(): Number of variables doesn't match numbe

MYSQL: Create Unique ID based on Another Column

If I have the following column in database: Email [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] I would like to ALTER

Limit listagg function to first 4000 characters [duplicate]

I have a query that uses the listagg function to get all rows as a comma delimited string to ultimately be shipped to a big text box. I'm gett

How change few columns to another table with key in SSIS?

I have: Collisions{PK_id, cashLoss, deaths, city, state, county} I want: Collisions{PK_id, cashLoss, deaths, #IdLocalization} Localization{#LocalizationID(a

How can I filter in Birt (Parameter) on a computed column?

Is it possible to add a parameter to filter by a computed column and if so how? I have a report which gives the level of a bill of material and this is set as l

Group function is not allowed here

When I run the following query, I get ORA-00934: group function is not allowed here what is the problem ? select c.Numcom,c.Nompr,c.salaire_fix from com

DB2 SQL How do I turn a number into a string then concatenate a percent sign onto it?

I would like to display 71% in my RESULTS field. I have rounded the decimal percentage first (it was 71.04), now I want to turn it into a string so that I can c

Decorator for Sqlite3

I have a simple sqlite3 function from sqlite3 import connect def foo(name): conn = connect("data.db") curs = conn.cursor() curs.execute(f"CREATE T

SQLite (Android) : UPDATE query with ORDER BY

Android, SQLite : I want to insert rows in between other rows in myTable using SQLite in android. For this, I am trying to increment ids of the all rows startin

How to get definition/source code of an aggregate in PostgreSQL?

I found this related answer useful: Export "Create Aggregate" functions from PostgreSQL But how do I get the CREATE AGGREGATE statement without a GUI client (

How do I go back to multi_user mode

Here is my query: IF EXISTS(%some query%) BEGIN BEGIN TRY ALTER DATABASE [MyDatabase] SET single_user WITH ROLLBACK IMMEDIATE; --d

Can't join FREETEXTTABLE with typeORM functions

I'm working on a graphQL backend with TypeORM I found FREETEXT, CONTAiNS, FREETEXTTABLE and CONTAINSTABLE options for fulltext searching in my SQL database. As

How to group multiple columns into a single array or similar?

I would like my query to return a result structured like this, where tags is an array of arrays or similar: id | name | tags 1 a [[1, "name1", "color1"

How to drop all tables from a database with one SQL query?

I don't want to type all tables' name to drop all of them. Is it possible with one query?

SQL values from a table with multiple groups

I have a table that has multiple persons linked to multiple groups. I have a procedure that needs to bring everyone from group 75588 but if this person is in gr

Filter rows from table 1 with table 2 info

I have 2 tables. One table listing results of a run and a 2nd table with timestamps. table1 (not sure how to add another column to the table but table 1 has an

How do these database management systems practically behave during a network partition?

I am looking into deploying a database management system, replicated across regions (various data centers across a country). I am currently looking into the fol

Find all stored procedures that reference another stored procedure

I want to find the all the directly and indirectly references to DB objects list. I am using below queries but I found the issue. DECLARE @Search varchar(255)

Need help by populating a PrimeReact Tree

I'm trying to populate a PrimeReact Tree with data from sqlite3 database, but it doesnt work. Here is my SQL-Query: select 'prj:'||p.id as key,p.name as label,(