Skip to content

Tag: sql

What does SELECT followed by a SQL command as a string mean

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…

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 …

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…

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