Category "sql"

Error: can not delete or update parent row

I'm trying to Delete all the records related to this supplier from all relevant tables for Supplier with supplierNum = S3. But when I try to delete, I get an er

Is there a way to build custom expression in SqlKata for the Select/Order clause

I wanted to pass custom expression to SqlKata The expected output is: SELECT DISTINCT(Column1 + ' ' + Column2) FROM Table1 ORDER BY Column1 + ' ' + Column2

Most donor to acceptor ratio

There is a blood bank which maintains two tables: DONOR that contains information on the people who are willing to donate blood and ACCEPTOR, the people who are

Eliminating NULL Values in SQL

I have a complex subquery within a query giving me this: Col 1 Col 2 value1 NULL NULL value2 value3 NULL NULL value4 value5 value5 But instead, I need this ou

http error 400 with esp8266 when trying to send a JSON objekt

Hej I wish to send a json objekt from my esp8266 to a SQL database which works when i test it with postman. The problem occurs when I try sending it from esp826

How can i submit a form with logged in user as default?

After you sign up, you are prompted to the login page, and after you login, you are redirected to another page that contains a form used for gathering additiona

Using multi character delimiter while exporting SQL table as text file using python

I am trying to export SQL table as multi-character delimited text file in python. I have tried using Pandas, but it is only supporting single character as delim

how to repeat a block of code in bigquery for multiple columns?

I would like to repeat a block of code with a complex operation (defined in a subquery) for many columns in bigquery. I cannot find a better way than copy and p

LISTAGG in Oracle to return distinct values

I am trying to use the LISTAGG function in Oracle. I would like to get only the distinct values for that column. Is there a way in which I can get only the dist

calculate a normal distribution in trigger SQL

I want to create a trigger in SQL when updating data in a column we will check what the data is and we will update in a separate column and use a normal distrib

Date scaffolding with multiple different date measures?

I want to show the amount of people in each contract status historically. I have a list of every contract's start date, suspension dates, expiration date, and t

Need help understanding why this query is producing these results

Consider the database entries below. The distinguishing identifier is the "short" item number, 89721. Data: F3003 IRKIT IRKITL IRMMCU IRMCU IREFFF

Android Studio: ContentValues vs Database.execSQL()

My question can be considered as a continuation of What is the difference between inserting data using ContentValues and Raw SQL in SQLite Android? My question

what is blanket update in SQL query?

I have a few update queries, and I need them as a blanket update. update Table_A set status=0 where task_type='AAA' and task_name='BBB'; update Table_A set st

Improving SQL Query to check condition

Currently, the sql code that I have is to check for the three fee_code records do any of them have election_code = NA. I'm trying to figure out how to change th

How to count elements based on a unique value in BigQuery

I have this table 1 in Bigquery and I need to count the elements in column segments and category that correspond to a single user id. Desired outcome presented

Group by Day of Month

Say I have a table logins with just the bigint id ,a date_login of type datetime, and fk_user of type bigint. I need to select the first and last logins for eac

Athena count/Sum column divided by count/Sum column returns zero

I am trying to find percentage based on id column. issue - I am trying to use count(column)/select count(column) from table which is giving output as 'Zero' Tab

Counts for time range per day

I have a table something like this create table widgets ( id primary key, created_at timestamp, -- other fields ) Now I want a query that shows the co

Apex Report to load last 30 min of data

I am trying to have an APEX report show only responses submitted in the last 30 minutes. Is it possible to do this with the where clause? Getting stuck with all