Category "sql"

Sql Database sync error in azure Database Sync Group

I'm trying to connect my local database with online database. I've followed the full procedure but Database Sync Group is showing a log error of following type

DB2 Querying a table for both DISTINCT and COUNT(DISTINCT)

I'm trying to query distinct Update_Date but also return a column that counts the total number of distinct Update_Date The table right now (Only Update_Date is

SQL Server 2019 - Pivot Result on multiple column

Please check my query and let me know what to do to get the proper result as expected - query: With ChemReq (AmdCode, ItemCode, itemcode1, D1K,D2K,D3K,D1,D2,D3)

selecting columns which are NOT of a specific type SQL

I want to select all the columns in BigQuery that are not of the type "TIMESTAMP". I have written the query which returns such columns which is: SELECT COLUMN_N

Getting bytes written to SQL database for integer column, want integer to be written

I am writing data from a dash app to a SQL database setup by Django and then reading back the table in a callback. I have a column that the value should either

Multi-part geometries: Get line & part number when extracting parts (via SDO_UTIL.EXTRACT_ALL)

I have multi-part SDO_GEOMETRIES in Oracle 18c. I can extract the parts as individual rows using the SDO_UTIL.EXTRACT_ALL() function: with cte as ( --Each part

BigQuery DENSE_RANK

I posted something similar to this but without the full code and I don't think people understood what I was looking for... I'm writing a query to examine bus st

is there a better way to add a list of integers containing users id as serialized json string to SQL as one record?

I'm working on a Blazor app that's similar to Facebook groups, I have to make a notification function where users can receive a notification message when someon

what is the type of interval in SQL Server DATEADD() Function? [closed]

For example: SELECT DATEADD(month, 2, '2017/08/25') AS DateAdd; I think it would be more sense to define argument as a specificed data type s

Different Schema name for SQL datasets in ADF using parameters

We have tables under different schema in same db in Azure SQL DB. eg. QA.Mytable and Prod.Mytable . so to manage this in Azure data factory for different enviro

Select rows from table where a certain value in a joined table does not exist

I have two tables, playgrounds and maintenance, which are linked with a foreign key. Whenever there is a maintenance on a playground, it will be saved in the ta

mysql return 360 degrees returned with strengths

I have a table of wind directions and strengths over a 24 hour period, sample data at the bottom of this question. only directions that have strengths are store

Find rows with duplicate values in two columns where at least one value in one column is a specific value

So, I'm not sure how it works and I haven't found a sufficient answer by googleing (probably not using the right buzz words). So here it comes: Let's say I have

How to order WHEN THEN to get all combinations of desired replace fucntions

I have a fake table: CREATE TABLE #FAKEAddress ( AddressLin01 varchar(100)) INSERT INTO #FAKEAddress VALUES ('123 FAKE ROAD'), ('79 59th ROAD'), ('7890 COUNTY

Oracle REGEXP_REPLACE for both space and "%" at the same time

I have following Oracle SQL code: SELECT TO_NUMBER(TRIM(REGEXP_REPLACE(per_growth, '(%)(\s)')), 'FM99999999999999999990D099999999999999999',

Match any letter in a string

Table flights: ID Path 1 NZ:EU 2 JP:CA SELECT path FROM flights WHERE path ILIKE '%' || 'jpca' || '%' Above query isn't working, it needs to retu

PostgreSQL timescale - How to sort rows by time and id?

I have data in my timescale database. If we only look at the "time", everything is fine. But if we look at the "id" we can see that 152 and 153 numbers didn't s

Improving the running time of SQL query

Assume the query below take a long time to run. To improve the running time of this SQL query, which of the options below are the best way to do so? SELECT Name

SQL inner join performance data duplicate

table -- > qt qstnId tagId 1 1 1 2 2 3 2 4 2 2 table --> question qid 1 2 qid is primary key and qstnId is Fk now when i'm running query --> mysql&

How to get what percentage of total users joined what number of meetings in PostgreSQL?

There are two tables, one is called "user_preference" that contains all users: id | firstname | lastname | email | And "match" which combines users with meetu