31 questions from the last 7 days
0 votes
0 answers
27 views
How to use SET TERM from Firebird SQL in DataGrip
To work with uni labs I need to write procedures and so that I need to execute given settings script with a command SET TERM ; ^. Executing this produces this error: [42000][335544634] Dynamic SQL ...
0 votes
0 answers
44 views
Performing product operation on consecutive true segments in a vector
I have two vectors of equal length, one integer vector and one boolean vector. I want to calculate the product of elements in the integer vector where the corresponding boolean vector has consecutive ...
-2 votes
0 answers
67 views
Oracle: how to filter for the partial date from any string appear in the column? [closed]
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 ...
0 votes
1 answer
49 views
Adding CHECK Constraint Without Error and Duplication [duplicate]
I have implemented this code to add a check constraint after creating the table ALTER TABLE recruitment_data.candidate_experiences ADD CONSTRAINT chk_experience_dates CHECK ( ...
0 votes
1 answer
67 views
How to remove duplicate rows based on array column subset relationship in DolphinDB?
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,...
Advice
0 votes
3 replies
59 views
Procedure to show percentage of nulls in TERADATA SQL ASSISTANT
I'm working in Teradata SQL Assistant and I need to create a stored procedure that, given a table name, returns the percentage of NULL values for each column in that table. Right now, I generate the ...
0 votes
1 answer
23 views
Redshift PartiQL for unpivoting the keys and values in a Map typed SUPER
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 ...
0 votes
0 answers
77 views
SQL statement in MS Access VBA criteria issue [closed]
I have the following SQL statement that works correctly strSQL = "SELECT well_API_14," & selectedField & ",ProductionMonth, Well_Name FROM PIH_Monthly_Allocated_Volumes where ...
1 vote
3 answers
74 views
How to group the data to avoid multiple rows
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 ...
0 votes
2 answers
91 views
Grouping of records in case values are null
We have got a table with a identifier, a key/value pairs and a start and end timestamp which indicates the valid period for the values. MASTER_WORK_ORDR_ID START_TS END_TS WORK_ORDR_ID_CTXT ...
-2 votes
1 answer
95 views
How to display in postgresql only the records that are not within the 10 minutes [closed]
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 | ...
-1 votes
0 answers
43 views
How do I add a SQL expression into a report that's based on a command?
I know I need to add it into the command, otherwise I have to rewrite the report without the command (it crashes that way due to too much data in prod). But I don't know how to write it into the ...
-2 votes
2 answers
64 views
Oracle SQL Test to identify missing rows for unique identifier
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....
Advice
0 votes
3 replies
38 views
Permission to view the body of a procedure/view/function from a read-only user on Oracle Database
I was wondering if there is any privilege or work around that allows a read-only user I created on Oracle to see the DDL of procedure/view/function from third party apps like SQL Developer. Currently ...
0 votes
1 answer
119 views
Make MySQL evaluate subquery first
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(...