Category "sql"

proc Sql Case Statement returning Null values

Can someone look at my Proc Sql and tell me why the below case staement is returing Null values in the data? I have never seen this, there are no errors, the co

How to do Group By and SELF JOIN in single table

Here is what I am trying to get done. Partly I am thru, Partly I am stuck, and need some help. Table structure: CREATE TABLE UserRole ( Id bigint NOT NULL A

Append Changed and New Employees to Existing Table

I have a table (Table 1) which is a list of employees and data points about them. The data that populated Table 1 is regularly changed and added to in its sourc

SQL Indexing not improving speed

Given an SQL database with index for (startpage, endpage), with a relation Articles(*ID*, title, startpage, endpage), why isn't a query SELECT title FROM Artic

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