Category "sql"

Redshift design or configuration issue? - My Redshift datawarehouse seems much slower than my mysql database

I have a Redshift datawarehouse that is pulling data in from multiple sources. One is my from MySQL and the others are some cloud based databases that get pulle

Why the indexes not speeding up the query?

I have the following query: SELECT TOP 1000 * FROM MyTable WHERE Status = 'N' AND Type is not null ORDER BY mytable.id MyTable has 130 million rows. I also

How to group data with SQL

How do I group my Timestream data? The table looks simplified like this: point_delivery_number | measure_name | time | value ----------------

Generate random pairs SQL

Suppose we have these two tables. TABLE1: |column_1 | ... | -------------------- | 'a' | ... | | 'b' | ... | | 'c' | ... | |

SQL Some vertical to horizontal field names/values

What I've read here doesn't quite answer what I'm trying to do. That's why I'm posting a request here and I'm confident to learn what I can do on this subject.

How to use group by function for more columns

I have used following query to get below output from my exisiting database. select date(RaisedTime) as date, object,User,Count(*) as total from table1 where obj

How to extract column names from SQL query using Python

I would like to extract the column names of a resulting table directly from the SQL statement: query = """ select sales.order_id as id, p.product_na

replacing null value

If i am using select coalesce(firstname, surname, petname) as column_name select isnull(firstname, surname) as column_name Where all return the first non-

How do I select floating-point infinity literals from a SQLite database?

I have a SQLite database with a table named measurements, which contains some experimental data measured by a power meter. They're stored as data type REAL in a

Userlogin time update

i have build a small website with a user login system. I want it so that when user logs in the 'UserThisLogin' value is being updated automatically but prior to

PowerApps filter returning incomplete data record...?

I have an Azure SQL database, and my records inside table Spiderfood_RITMData in that database includes 13 different fields. Lots of stuff. I have confirmed in

improve sql query with 2 EXISTS sub queries

I have this query (mysql): SELECT `budget_items`.* FROM `budget_items` WHERE (budget_category_id = 4 AND ((is_custom_for_family = 0)

SQL- all rows which are present in all years

I have the following columns in my DB Codes year | code | ---------------- 2009 | 10001 | 2009 | 10002 | 2009 | 10003 | 2010 | 10001 | 2010 | 1000

How to replace starting two digit (00) with blank space in T-SQL?

I have a table where as codes are present in the form of 78,7244,d345 by default few records are found where the codes are start with 0072 . I have to delete st

Datagridview Error After Rowfilter -> Data Update/Add and Fill Process

I have a datagridview which filled by SQL table. When I search a value with a textbox in the data and update/insert the some values and use fill function again

Joining MySQL table

in my database there are 2 tables : posts, room Posts tables include ID and Title columns and includes many rooms and hotels titles and IDs. In the room table t

Deadlock on Select from table-valued parameter

I have this piece of code which acquires connection from EF Core DB context and executes select on the received data. var conn = _dbContext.Database.GetDbConnec

LARAVEL: How to fetch id dynamically in a query builder?

I want to join multiple tables in laravel with query builder. My problem is that my code only works if I specify the id myself that I want like this: $datauser

Calculating the mode/median/most frequent observation in categorical variables in SQL impala

I would like to calculate the mode/median or better, most frequent observation of a categorical variable within my query. E.g, if the variable has the following

How to parse json data in a column with Druid SQL?

I'm trying to parse json data in a column with Druid SQL in Superset SQL lab. My table looks like this: id json_scores 0 {"foo": 20, "bar": 10} 1 {"foo": 30, "