I try to find a way to let the SGBD perform a population of merge fields within a long text. Create the structure : CREATE TABLE [dbo].[store] ( [id] [int] NOT NULL, [text] [nvarchar](MAX) NOT …
Does SQLite support character range with [ ]?
I’m trying to use Northwind version in SQLite (someone posted it on Github and it’s super handy), but my query for selecting employees with last name starting with B, C, D, …, L using LIKE returns empty table: The table contains such names (most of them, in fact). Does SQLite not support cha…
How can I utilize a partial index for the calculated filter condition in a where clause?
Let’s say I have this simple query: EXPLAIN ANALYZE SELECT COUNT(*) FROM audiences a WHERE a.created_at >= (current_date – INTERVAL ‘5 days’); This is a 1GB+ table with a partial index …
Select rows in left join which depend on sum of a field in the other table?
Im trying to write a SQL left outer join query where the left rows are selected based on the sum of a field in rows in the other (right) table. The other table has an id field that links back to the …
MySQL Join Over 5 tables
The Situation We have these 5 different MySQL tables: Table club Id | ClubName | CityId —+———-+——– 1 | Test | 1 Table city Id | CityName | CountryId —+———-+———– 1 | …
Filtering records not containing numbers
I have a table that has numbers in string format. Ideally the table should contain 10 digit number in string format, but it has many junk values. I wanted to filter out the records that are not ideal …
Postgres: how to check for records in time buckets for multiple values
I have a POSTGRES table with roughly the following shape: sensor_id | recorded_at ———-+——————– A | 2020-01-01 00:00:00 A | 2020-01-01 00:03:00 B | …
Tasks in snowflake – multiple SQLs
Can a Task execute multiple SQLs at a time in single transaction? I know stored procedure does but wanted to see if we can start a transaction in task and execute multiple SQLs
JOIN MAX per Group
I have a pretty simple sql: SELECT TRIM(Branch.Area) “Area”, Branch.Article “Article” FROM DBA.Branch Branch …
How to sum a column in Postgres
I create this table and inserted in it. I use PostgreSQL. How to write a query to have what i need. I need total amount of each column. below it Thanks. CREATE TABLE testTable ( id INT, …