I’m trying to combine two tables together with a third that is comprised of a single column that is a combination of the two tables primary key column. I’ve considered using substring to separate the …
Category: Questions
Get all date from month – Oracle SQL
I have two parameters MONTH and YEAR, how get all date? Eg. YEAR = 2021, MONTH = 8 Date —— 01.08.2021 02.08.2021 ….. 31.08.2021
INSERT INTO SELECT AND VALUES
Error: “Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.” Answer The error is pretty clear. The outer select returns too many rows. You can just remove it: Note that the constant values are included in the select.
NULL changes to 0 when added to the db
Ok I have tried everything I can think of, I couldn’t make it. I am creating some inputs like this: And then when I get the $_POST I am checking if the input is 0 or “” and setting it to NULL. And I am adding to the DB with this But when the query runs, qty6 (for example) that
Merging Rows and put values in different columns
I have the following table: and want to get to this result: An ID value in the first table occurs max 4 times: Booked + 1 = was either marked booked the first time in database OR was either marked booked the last time in database Booked + 0 = was either marked not-booked the first time in database OR
SELECT WHERE multiple records don’t exist
I have the following two tables. attempts: attempt_tags: I’m looking to select a record from the attempts table where (for example) tagid 2 and 11 are BOTH not present, so the result of the query in this example would return everything except for id 40. I initially thought this question would be a good solution, but I’m not as convinced
Trying to split one column to multiple columns using Snowflake sql
data need to get split from SOID column to Circ,Language,Words as show above in pic. When trying with below logic :- the data is getting handled correctly, But as per the pic highlighted in yellow some data is not getting captured with the above logic. Instead of shoing language as English, it is shwing null, and circuit as Biotechnology…. it
SQL: escaping with backslash
I’m writing a lexer for SQL for syntax coloring and have the problem of parsing code like Is my understanding correct, that escapes some characters like underscore (_), but not if it is followed by a single quote (‘)? Does the escaping depends on the SQL dialect or is the behavior the same for all (or a lot of)
Using SQL result as a filter for another query
Here’s my code and there’s a thousand transaction_no result. Which is I have to use as a filter for another code with the same table. Answer You could use in, if you want to filter on the transactions: If you want all rows for transactions that have the specified item, you can also use qualify:
How can I easily convert 139.29.0.0 to 139.029.000.000 at sql?
How can I easily convert 139.29.0.0 to 139.029.000.000 at sql?