674,684 questions
-3
votes
1
answer
40
views
Bringing together results of two different SQL data given certain criteria [closed]
I am attempting to clean up our database and clearing out old records and that are not used. Primarily deleting any user ids that are not set on any file record in the system.
I have three tables,
...
0
votes
1
answer
81
views
SQL query produced by Entity Framework very slow
I have the following query being generated by EF:
DECLARE @__term_0 VARCHAR(7) = 'woodrow'
DECLARE @__p_1 INT = 0
DECLARE @__p_2 INT = 15
SELECT [t].[Id], [t].[City], [t].[Contact], [t].[CreatedBy], [...
0
votes
1
answer
43
views
Normalize JSON array in Clickhouse
I have a Clickhouse table with following structure:
id
json
111
[{"productId": "718f4d00-210d-43f1-9c9c-e97733d38972", "cost": "170.00000"}, {"productId&...
1
vote
3
answers
73
views
Allocate value to a constant column with a group of multiple rows in Oracle SQL
I have data in a table like this:
columnA here is constant value within the group of rows with columnB consisting of id's 1,2,3,4
I am trying to write a SQL query to allocate the value of the columnC ...
1
vote
1
answer
24
views
How to reverse a DolphinDB table aggregated by group by + toArray back to its original form?
I have an in - memory DolphinDB table created as follows:
ticker = `AAPL`IBM`IBM`AAPL`AMZN`AAPL`AMZN`IBM`AMZN
volume = 106 115 121 90 130 150 145 123 155;
t = table(ticker, volume);
t;
The output of ...
-4
votes
0
answers
52
views
Fixed to allow for NULL value on input for database made using Entity framework, now need to fix rudimentary search function? [closed]
I went through a bunch of steps to get all the database etc generated (and had to manually go back through to tweak the db columns as Null and change data types) but when I run it and try to create a ...
0
votes
0
answers
48
views
Way to transform a BalanceSheet from QBO inside BigQuery?
I'm using dbt models to transform a QBO Balance Sheet uploaded as a CSV into Bigquery.
Data comes from a fictional company inside QuickBooks test drives from which I export reports in CSV format.
Here'...
0
votes
0
answers
31
views
How to wrap Azure SQL sp_execute_remote as a table function? [duplicate]
Having the SQL stored procedure remote_usp_test in the remote database, I can successfully call it using the sp_execute_remote from the local database like this:
EXEC sp_execute_remote N'xxxDataSrc', ...
0
votes
1
answer
53
views
How to perform asof join (aj) with strict inequality (<) instead of default (≤)
I am using DolphinDB version 3.00.0.6 and have two in-memory tables A and B.
I need the equivalent of a Non-Equi Join with strict inequality (A.date > B.date) to find the latest record in B that is ...
5
votes
2
answers
133
views
Preserve a foreign key using a uniqueness constraint while dropping a primary constraint
I have a SQL Server database I mostly interact with using EF Core in a .NET project: I'll analogize my domain logic for simplicity.
I have a Fruits table holding general fruit data in columns Weight, ...
0
votes
0
answers
21
views
Latest Row ≤ a target timestamp per deviceid (single statement) [duplicate]
I’m on GridDB Cloud (Free). For a TimeSeries container I need, for a given :target_ts, the latest row at or before that timestamp per deviceid in one SQL statement.
Schema & Seed Data:
CREATE ...
0
votes
0
answers
57
views
Get hierarchical structure from a single table
Expected result is somewhat hierarchical structure from a single table in griddb cloud as shown in below table, where every row contains hourly data in a way that there is only one device entry per ...
-1
votes
0
answers
56
views
Get list of files from external snowflake stage based on where condition on timestamp column
I am trying to get the files that arrived on the snowflake external stage after that have MODIFIED_DATE > MAX(BATCH_END_TIME).
I came up with this query:
LIST @my_internal_stage;
SELECT count(...
-1
votes
0
answers
60
views
How to solve "JdbcSQLSyntaxErrorException: Function [FunctionName] not found; SQL statement:" [closed]
I am implementing integration tests for a controller using @SpringBootTest and when I do a request to an endpoint, the request reaches the repository, a Query is sent and the error occurs. It is ...
2
votes
1
answer
74
views
jOOQ removes SQL inside ignore comments during execution
I'm using jOOQ with PostgreSQL and want to execute a query with an EXPLAIN (ANALYZE, FORMAT JSON) prefix.
I set the parser settings to ignore comments:
Settings settings = new Settings()
...