Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
0 answers
41 views

I am using PostgreSQL 18.0 and I have written a function with default parameters which inserts movie into the table. However, when I add the argument which must be added, it gives error: SQL Error [...
Beliz Yazici's user avatar
0 votes
1 answer
60 views

I'm trying to calculate the percentage contribution of each firm to the total amount across all firms. Database: google-bigquery What I need (desired output): Sum usde_haircut_amt per firm Compute ...
sandesh kamera's user avatar
-2 votes
0 answers
75 views

I have a case where I need to filter for the partial date string from a column. Here is the input: date_value ----------------------------- 7-03 start 4444 03/2022 follow up 1111 7-03 03/2022 ...
Hari's user avatar
  • 15
0 votes
1 answer
74 views

I have a DolphinDB table with an array vector column. I need to remove duplicate rows based on subset relationships within that column. Sample Input: sym prices a [3,4,5,6] a [3,4,5] a [2,4,5,6] a [5,...
xinyu zhang's user avatar
0 votes
1 answer
24 views

AWS documentation for querying Redshift's super is very much all in on supers that are arrays. But, I happen to want a super that is a map, as I'm sure a number of people do, and I would like to then ...
dlamblin's user avatar
  • 45.6k
1 vote
3 answers
78 views

I have an employee Manager table where you can see for every deptID, there are multiple rows. A few rows have null employeename and a few rows have null managername for same DeptID. i would like to ...
unicorn's user avatar
  • 590
-2 votes
1 answer
107 views

For example, I have this table below, how can I display only the records that aren't in the 10 minutes range. In this example should return the first and last in note examples user_id | ...
Luis's user avatar
  • 2,711
-2 votes
2 answers
70 views

I am trying to find an Oracle SQL to test whether a table (CONTACTS) contains two rows of data for each primary key (PK) called REF_NO. The table has a PK called REF_NO and a second PK called CONT_IND....
Sean Whiting's user avatar
0 votes
1 answer
125 views

SELECT tt.trans_type_name AS transaction_type, trans.transaction_time, a.trans_action_name AS transaction_action_name, trans.transaction_notes FROM(SELECT Cast(...
Thomas A Mathew's user avatar
1 vote
1 answer
74 views

I have the following SQL to create a materialized view and the SQL seems reasonable to me but it's unclear from Postgres docs what should happen in this case. I am listing the columns when creating ...
Byofuel's user avatar
  • 448
1 vote
1 answer
112 views

I have a table test with two columns, each referencing the other ID1 ID2 2 1 3 2 4 3 5 4 Given an id, I need to traverse the chain to return all the rows traversing the chain. Below is the query I ...
sg2000's user avatar
  • 325
Advice
2 votes
7 replies
101 views

I am trying to take the output of a SQL query and split it evenly into 3 HTML columns such as flexbox divs. Obviously the output total won't always be evenly divisible by 3 and the first 2 totals ...
Larry Moss's user avatar
0 votes
1 answer
72 views

I’m working on a data quality workflow where I validate incoming records for null or missing values. Even when a column clearly contains nulls, my rule doesn’t trigger and the record passes validation....
Neha Upadhyay's user avatar
2 votes
1 answer
115 views

I have this table in SQL: CREATE TABLE myt ( name VARCHAR(20), country VARCHAR(20), date_arrived DATE, date_left DATE ); INSERT INTO myt (name, country, date_arrived, date_left) ...
stats_noob's user avatar
  • 6,845
3 votes
1 answer
92 views

I'm trying to help a user in another stackoverflow question and have bumped by head into a strange behaviour. As I rarely use MariaDB, I'm opening another question to investigate the behaviour, ...
MatBailie's user avatar
  • 87.4k
3 votes
3 answers
129 views

I have a SQL table in postgres 14 that looks something like this: f_key data1 data2 fit 1 {'a1', 'a2'} null 3 1 {'b1', 'b2'} {'b3'} 2 2 {'c1', 'c2'} null 3 Note that data1 and data2 are arrays. I need ...
fitek's user avatar
  • 303
1 vote
4 answers
210 views

I am using MariaDB v10.11.15 (a MySQL fork) which does not support the LATERAL keyword, to lookup the countries of 30 IPv4 numbers. I have the following query that retrieves the country when given an ...
George Robinson's user avatar
Best practices
0 votes
7 replies
154 views

I am trying to find the right pattern which can extract the date from any string """ 28/11/22 11-23333 to 28/11/22 11-23333 28/11/22 to 28/11/22 something 20.02.2022 end to 20....
Hari's user avatar
  • 15
0 votes
2 answers
86 views

I'm trying to get SQL to generate a count of rows based on 2 values, from a table like shown below Table Data: ID NAME VALUE device_id 1 name_1 enabled 1 2 name_2 enabled 2 3 name_3 enabled 3 4 name_1 ...
Anurag Kumar's user avatar
0 votes
1 answer
55 views

I want to query multiple tables across databases, something like: declare @sql varchar(100) select @sql = 'select * from mydb1..mytable' select @sql = 'select * from mydb2..mytable' exec(@sql) ...
levant pied's user avatar
  • 4,651
0 votes
4 answers
135 views

According to Google this should be the query to find the PK name: SELECT constraint_name FROM user_constraints WHERE table_name = 'YOUR_TABLE_NAME' AND constraint_type = 'P'; However, it does not use ...
Igor's user avatar
  • 6,473
2 votes
2 answers
180 views

I have two tables: demo at db<>fiddle Table keywords has two columns id and v (which hold the keyword's value) create table keywords( id int generated always as identity primary key ,v text ...
Thomas Tempelmann's user avatar
0 votes
0 answers
102 views

I am getting error using GROUP BY RANGE in GridDB sql. I am referring to the example mention in the doc https://griddb.org/docs-en/manuals/GridDB_SQL_Reference.html#group-by-range name: trend_data1 ts ...
sayana_dutta's user avatar
5 votes
4 answers
206 views

I have the following table definitions: Table public.messages: Column Type Collation Nullable Default ip text msg text ignore boolean Table public.host: Column Type Collation Nullable Default ip text ...
Andreas Weigl's user avatar
-4 votes
0 answers
99 views

I'm calculating a conditional cumulative sum in DolphinDB SQL that resets the accumulator when the value changes sign (from 1 to -1 or -1 to 1). Here's a complete, reproducible scenario and my ...
Liu lu's user avatar
  • 1