673,481 questions
Score of -2
1 answer
118 views
Faster way of getting unique comma separated list within SQL query [closed]
After adding in additional variant tables (and increase in data), some SQL views have become unacceptably slow.
I think the problem is this 'clever' trick I'm using to pull what could otherwise be ...
Score of 0
0 answers
168 views
SQL vs R cleaning large rideshare, which approach is more efficient for 1M+ rows? [closed]
I am working on a real-world rideshare efficiency project as part of the Google Data Analytics Certificate.
I have a BigQuery dataset with over 1 million rows. It has two main issues:
The pickup and ...
Score of -7
0 answers
85 views
Query gives unknown column in field list [closed]
I'm practising with my database "Parcial 1".
The problem is that when I execute the entire query it throws an error:
Error Code: 1054. Unknown column 'h.nro' in 'field list'
I ran:
select ...
Score of 1
5 answers
147 views
Return multiple text and associated number from string
Trying to return all instances of a word and number from a string, I've put this together but only grabs the first occurrence as opposed to looping through the string to return all instances of text+...
Score of 1
1 answer
131 views
Joining 3 tables and multiple parameters
I have these three tables:
TicketType table:
id
ticket_type_id
ticket_type_name
event_id
campaign_id
1
GEN
General Admission
123
1
2
VIP
VIP Admission
123
1
3
GEN
General Ticket
123
2
4
VIP
VIP Ticket
...
Score of 0
0 answers
253 views
Why is Dapper failing to substitute a parameter in a SQL statement
I have the following method in my code to query a table with an encrypted column in SQL Server.
public async Task<ConnectionDetails?> LoadConnectionDetailsBy(string systemId, CancellationToken ...
Score of 2
2 answers
256 views
How to bypass PostgreSQL's 100 function parameter limitation for IN and FIELD
I'm hitting the 100 parameter limit wall for a Postgres function. See an example below, though there can be an arbitrary number of ids in the lists:
select id, contained_by, hsmtype
from hsm_table
...
Score of 0
0 answers
10 views
SQL Server 2022 PSPO does not create multiple query plans for a highly skewed parameter [migrated]
I am trying to demonstrate Parameter Sensitive Plan Optimization (PSPO) in SQL Server 2022 using a highly skewed dataset.
My Orders table contains about 10 million rows:
OrderStatus = 1 → ~9,999,000 ...
Score of 3
1 answer
135 views
MariaDB query is much faster when using CAST() on bound parameters?
We use a MariaDB database (with stored procedures) and pass params via PHP middleware.
A minimal example of the table and view defintion I'm using:
CREATE DATABASE cast_demo
CHARACTER SET utf8mb4 ...
Score of 0
0 answers
93 views
Validate_Conversion - understanding PLS-00801: internal error [*** ASSERT at file pdz2.c ... ] [duplicate]
I'm maintaining a legacy Oracle DB (12c) and I get this error:
PLS-00801: internal error [*** ASSERT at file pdz2.c, line 5338; The_Exp is null.; MY_LEGACY_PKG__MYSCHEME__B__132628[572, 46]]
...
Score of 5
1 answer
144 views
AT TIME ZONE with unknown-type string literal: no error, but timezone not applied?
Why does AT TIME ZONE on an unquoted string literal not throw an error in PostgreSQL, and why does its result type differ from explicitly casting to timestamp first?
I noticed some unexpected (to me) ...
Score of 6
2 answers
161 views
Casting an out-of-range counter through DOUBLE clamps it to INT64 max
A gateway import table temporarily stores counter values as strings. One device sent 9223372036854775808, which is one greater than the maximum INT64. I expected every conversion path to reject it, ...
Score of 0
1 answer
173 views
SQL query returns duplicate rows when joining three tables with GROUP BY [closed]
I'm trying to get a summary of customer orders that includes the total number of orders and the total amount spent, but my query is returning duplicate rows and inflated totals instead of one row per ...
Score of 2
3 answers
181 views
Retrieve data, but only from those that are present at both of two specifed locations in a separate connection table
I want to build a query that retrieves things from locations, but only the things that are present at both of two locations specified by the user.
This is the Things table:
thingId
name
1
thing one
2
...
Score of 2
3 answers
165 views
Is :customer_id really all I need to securely isolate client data in CustomerDashboard.io?
I’m building a dashboard panel for an influencer marketing agency using CustomerDashboard.io. The clients of this agency need to log in and view campaign metrics like impressions, reach, and ...