The table has a column that is type varchar6 containing 6 numbers between 000000 to 999999, or is empty. No matter what values you give the various variables for this column SEQ, it keeps returning no results but no syntax errors. I suspect you can’t find anything in SQL if you do a between with two varchar6’s. The sql query
Tag: select
Lag() function with WHERE clause
I have this sql function that works properly: SELECT out_hum , (out_hum – LAG(out_hum, 1) OVER (ORDER BY id)) As dif FROM excel_table But I want to select all the out_hum when the diferrence (dif) …
call value from another table when the value is not null
I want to get the value from table stage_cdl if it has value and from tale stage_vdl if it has value. Before this, I used this code (below) but I only receive the array until value 5 not include the table stage_vdl_id. The output: invoice_stud table stud_stage_cdl table stud_stage_vdl table license_cdl_module table license_vdl_module table Here what I’ve done so far,
How to find distinct columns in a nested subquery in SQL?
I need to find the distinct drinkers that ordered ‘VODKA’ and ‘WHISKY’. I AM ONLY ALLOWED TO USE A NESTED QUERY. No other format is accepted. I am quite new to sql so any help would be greatly appreciated! Here are the tables I am trying to retrieve data from: Here is my SELECT statement so far: INSERT STATEMENTS: DESIRED
Select everything from SQL database except duplicate
I have a database that looks like this: It measures how many times participant1 and participant2 have shaked hands. I want to select the amount of times total people have shaken hands (without the duplicates counted). So in this example the output would be like this: Can anyone help me with the SQL Statement to do so? Answer With NOT
Select Unique value from a JSON Array – PostgreSQL JSON column
I have the following JSON document stored in a PostgreSQL JSON column: I am trying to retrieve the price for specific customer_ID I am using this query to get the price for Customer_ID=1 The problem is that i am getting the same results for Customer_ID=1 and for Customer_ID=10 I am basically getting both elements of the array instead of just
Select based on multiple ID’s in the same column
I have two SQL tables already built (not by me) : One table that has all the ingredients with ID’s assigned to them : and the second table that has finished products that have reference to ingredientID in the ProductIngredients column but no the product name and they are built like this : If they don’t have any reference then
what is the query in oracle sql to find product orders before a certain date?
how do i find all the customers who have made orders before 2017. List must incld the customer ID, customer name, and ordered by their ID values in desc Answer You can use exists and a correlated subquery to filter customers who ordered before 2017. We can get that information by looking at the orders table only:
How to extract text between two words in Oracle
This is the source string: random foobar “name” : “Jack Ryan”, other random stuff In Oracle query, how do I extract Jack Ryan from it? I guess I am looking for whatever is between “name” : ” and “,…
mySQL – Check Table for duplicates efficiently
I have a table “people” where (for simplicity) everyone has an ID, this ID is not unique so two entries can have the same ID. I now want to find all duplicates which I would do like this: SELECT p1….