Category "sql"

Selecting rows with id's from two other tables

Let's call this table service_status: +---------+----------+-------------+------------+ |service_id| output | created_at | updated_at | +---------+--------

Full text search failure on PostgreSQL

I have a PostgreSQL used to index text content. The SearchVector column is created successfully using the following code UPDATE public."DocumentFiles" SET "Sear

Is there a free version of SQL server that has Integration Services Catalog too?

Trying to understand what free version of sql server allows to create Integration Services Catalog for SSIS pacakges. Any help is appreciated. Thanks.

How can I count a value in SQL

I have a table with the columns company_id, shipment_id and trip_id. I am asked to find out which companies have less than 4 shipments on a single trip. The que

Teradata - YEARFRAC equivalence

I am having a hard time trying to find something that would be equivalent to YEARFRAC (Excel) for Teradata. I messed around with the below, but want I want it t

how to create a user in postgres to connect to nodejs?

It is my first time using postgres and I am trying to use it with node. I installed postgres in Ubuntu and created the user admin sudo -i -u postgres createuser

Avoid incrementing primary key if insert is not successful?

I have a 'locations' table as follows: Using an API, if I send a valid record, the table will start normally with index 1. If I send something that won't be ac

error in migration with legacy database in Django

I'm working on creating a filter in django where the options displayed are coming from a new column in the database. It turns out that this column was created d

StackOverflowError when connection to aurora using mariadb java client

When connecting to an aurora db using the mariadb java client (version 2.7.5) i am getting this error (I only put the first few lines because the entire stack i

How can I select few columns with MAX(column) from several grouped columns?

My table has a lot of columns, I didn't list them all at here. But the selected columns are like below: product_line test_port rate1 rate2 test_stage finished_

Error mysql syntax use 'declare pfee int default null;',check the manual that corresponds to your MySQL server version

delimiter // create procedure payFees(in deviceid int, in fee int) begin declare pbalance int default null; declare ptype varchar(2) default ""; dec

Missing dates for specific identifiers without adding extra dates when this identifier is no longer in the database SQL

To put the problem in words, I have a massive table which includes subscribers and data for every day. If the subscriber no longer exists, then they will have n

How to work with column containg array in H2 database to get n 1 row

I am new to H2 database. I have 3 tables in database for example, table t1 : ID desc something condition_id 1 EN 142868 151508 XYZ [4686, 4687] table condition

Slow Query in WooCommerce, what to do?

I have written a Plugin that displays the sum of all purchases of all customers of the last year, ordered by the sum (Customer who bought the most is on top). I

How to map nested freezed union classes to drift/moor sql tables?

I need to save this Objects into a SQL/Drift DB, how can/should I design die Tables/Rows for an efficient mapping? Here is are examples of a (deep)nested union

How to delete a record depending on the following record

I have a table with the following columns Car | User | Location | Time | Type The type can be 'OUT' if the user's request to rent the car is accepted

In SQL, how do I filter a parent with its child records if either satisfies a condition

I have the following table as example. I want to retrieve only the records where the ScheduleDate is smaller than 2022-01-03 (Jan 3, 2022) for either the parent

How to Join two tables and update a column?

I have two tables as below TableA TableB ID1 ID2 ID1 ID3 1 X 1 X 2 NULL 2 A 3 (NULL) 3

How to get tally of unique words using only SQL?

How do you get a list of all unique words and their frequencies ("tally") in one text column of one table of an SQL database? An answer for any SQL dialect in w

SQL Developer Language won't change

I have an issue with SQL developer where the GUI language won't change as it shows here Now I have tried the solutions where I added the following to sqldevel