673,639 questions
Score of -4
0 answers
112 views
Replace zeros with NULL values [closed]
I am querying a 2023 weather dataset in Google BigQuery to analyze the relationship between wind speed and visibility.
In the raw dataset, missing values were recorded as 0 instead of NULL. I want to ...
Score of 0
4 answers
136 views
How do I get each unique value (not combination) to appear at least once?
I need to generate a dataset that has a bunch of null data, in order to display a visual that includes 0s when applicable.
I have a primary query that looks something like this (this is implified):
...
Score of -4
2 answers
144 views
What SQL function would I use to locate specific words in a dataset? [closed]
What SQL function would I use to locate specific words or phrases within a dataset? I’m trying to understand how SQL can be used to search through text stored in a database and identify records that ...
Score of 3
1 answer
170 views
Create a function to show ten rows of a table
I find myself running something like select * from table_name limit 10; often just to get a quick overview of a table.
Is there a way to create a function that I can run as topten table_name that will ...
Score of -4
2 answers
168 views
Query with LIKE / IN [closed]
We have a procedure where the IN parameter is a ticker, like AAPL, META, F, etc. The tickers passed in can come as a single value, like AAPL or a delimited list like: AAPL,IBM,DELL,UNP.
In the ...
Score of 0
1 answer
99 views
Any recourse with applying a functional based index to multiple situations?
I have been trying to utilize Oracle's function based indexes (as opposed to a virtual column with a normal index), to simulate a unique constraint on a subset of data.
For example:
orders
|- id
|- FK(...
Score of 0
0 answers
96 views
Why does A BETWEEN B AND B in a JOIN produce a different plan than A = B? [migrated]
I'm running a three-table join in MySQL compatibility mode (OceanBase CE 4.4.2.1) and noticed that rewriting equality join predicates as BETWEEN with identical bounds changes both the execution plan ...
Score of -2
0 answers
101 views
Query has Error 1054 Unknown column 'temp.category_id' in on clause [closed]
The first query is copy pasted from someone and works fine as expected. The column 'temp.category_id' in the on clause coming from the subquery 'temp' is recognized correctly and 1000 rows are ...
Score of 1
2 answers
141 views
Selecting non blank data in aggregation query
I have a table with some order data in it: A simplified summary is like this:
OrderNum
Revenue
Payment
RecordType
OrderData
1
30
0
Order
Shirt-Size:Large
1
0
30
Payment
2
20
0
OrderAmended
T-Shirt:...
Score of 0
2 answers
109 views
A query with a field that counts the number of fields > 0
I created a query with fields containing values (quantities of items in different warehouses) from the table named TABELLA.
The query checks the "Check_ID" field of the "TABELLA" ...
Score of 2
6 answers
263 views
Sorting by AM/PM time
I am trying to sort my data by time, but I have not been successful. My ActivityTime column is currently a string with HH:MM:SS AM/PM format. However, when I am trying to sort, it is not taking into ...
Score of 2
2 answers
202 views
View query results from a PL/SQL block without PUT_LINE, RETURN_RESULTS, or CREATE?
I'm trying to create a PL/SQL block that will generate a query in the client interface, but I'm having difficulty due to my restrictions and the restrictions of the client.
My restrictions are that I ...
Score of -1
1 answer
145 views
Insert record with foreign key if primary key is missing or not?
I have two tables with a primary-foreign key relationship.
A value in the foreign key table must be present in the primary key table.
What is a stored procedure to insert a record into the foreign key ...
Score of 1
2 answers
136 views
Create a query with columns containing sums of values from a table
I have a table with 3 columns:
Part Number
Location (where the part number is stored - 4 cities "London, Paris, Rome, New York")
Quantity (how many products are stored in that location)
I ...
Score of 0
1 answer
62 views
Store a multi char prompt into a variable in SQL under BO
With WebIRC (v4.3 SP2 with Oracle 19), I want to have in the report a variable containing the list of the selected values in the prompt pop-up.
I tried this (simplified code) :
SELECT
REFERENTIEL....