What does something like mean? I know usually you have the column name after the select, like SELECT first_name, but what does it mean when it is in single quotes? I believe the || means to concatenate the strings. Sorry, I’m new to this and couldn’t seem to find anything about this. EDIT: Sorry I…
Tag: sql
Why doesn’t the WHERE work in this sql query
I’m writing a SQL query that needs to only show the results where the ‘titel’ is the same as ‘Baklava’, but it doesn’t return any rows. When I try to use the query without the WHERE, is shows all the results, but I need the WHERE clause to work. Here is the query I’m …
Conditional where clause in Oracle SQL query is not working
I am trying to do a select on Oracle DB with this condition but it is not working. Table POST but when endDate is null I got the error Please help Answer The solution was to transform the Date in String, and in the select do this and (:endDate is null or pl.date_end <= TO_DATE(:endDate , ‘yyyy-MM-dd …
Oracle SQL: Using WHERE LIKE but for specific whole words / REGEXP_LIKE
I have a table of invoices with cost identifiers saved in a specific way, non always standard, like below: I would like to find invoices for a specific cost identifier. The structure of the cost is (4 or more digits)+(2 year digits) In Test case: 107621, the desired output would be ID: 2 and 3. SELECT * FROM …
SQL -Pivoting a column from a table which have Unique records
I am trying to pivot a table to Row which have duplicate records on all columns but, a unique ID Named ([log_ID]) at the last columns . I wont log_ID field pivoted and given dynamic name as log_ID_1 ,log_ID_2 …etc FYI – THE log_ID’s is not static they change at every execution’s they c…
How to merge two array if one item exist in both array?
I want to expand my city array with post code value. If the city_postcode array contain city array name record then push postcode value into city array. That’s what i want to achive somehow. city array: city_postcode array: The result I want: Answer If you can rely on the cities and post codes to be equ…
Implementation of QueryCache
Aside from doing a direct match on something like a whitespace normalized hash of a query, what might be a useful (but-not-necessarily-perfect) way to handle query cache in a partial manner? For example, let’s take the following basic case: This potentially could be used as a ‘base-cache’ up…
Snowflake – Issues with table filtering on dates
I’ve created a query that produces a set of dates based on start and end date. Everything works fine, but when I try to filter the underlying table to only produce the records between my range, it still results with all the underlying dates. I’ve tried using between, changing the variables to date…
Adding custom value to SELECT
I have this query: I want to use the record_dt of the second query as a replacement of the record_dt in the first query. I want to do that by linking the values on the part_id since they both have it. First query is giving a list of record_id that has part_id, the second query is taking the latest record_dt
How can I replace this correlated subquery within a function call?
Given the following tables buckets points And the following query Output How can I remove the correlated sub-query to improve the performance? Currently ~280,000 points * ~650 buckets = ~180,000,000 loops = very slow! Basically I want to remove the correlated sub-query and apply the width_bucket function only…