Category "sql"

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,(

The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server "(null)"

I'm trying to run the following statement but am receiving the error messages just below. I have researched answers to no end and none have worked for me. I'm

Default row order in SELECT query - SQL Server 2008 vs SQL 2012

Our team recently upgraded our databases from SQL Server 2008 to SQL Server 2012. One breaking change we noticed was in the default order of rows returned by th

How to efficiently remove duplicate rows in Spark Dataframe, keeping row with highest timestamp

I have a large data set which I am reading from Postgres. It has an ID column, a timestamp column and several other columns which may have been updated. For eac

Query to display Employee and Manager

I have to write a SQL Server query to display the employee last name and his respective manager’s name, as given below. John works for Robert Jane works f