i have the following table : Dt Status 05.23.2019 10:00:00 A 05.23.2019 11:00:00 B 05.23.2019 12:00:00 B 05.23.2019 13:00:00 D 05.23.2019 14:00:00 A 05.23.2019 15:00:00 …
Select from column including null values
I’m trying to create SELECT that includes various foreign key to list all the rows it has, but there is two foreign key that can be null. bank_id and bbank_id can be null, so with this example it …
SQL – How to get only current and previous value for each ID
I have a table id, date, value a, 5/22/2019, 22 b, 5/22/2019, 22 c, 5/22/2019, 22 a, 5/21/2019, 21 b, 5/21/2019, 21 c, 5/21/2019, 21 a, 5/20/2019, 20 b, 5/20/2019, 20 c, 5/20/2019, 20 Want …
How to force a MySQL query to return a 0 when the result of query is nothing?
I have the following query: SELECT SUM(quantity) AS qt FROM stockMove WHERE date_mov >= ‘2019-04-01’ AND date_mov <= '2019-04-30' AND ProductCode = '000807' GROUP BY ProductCode If a have …
Split pipe separated string – Oracle SQL
I have a table with the following structure: table1 f_name f_content test1.txt |0002434299|354534|535345345|05|||BCV RESULT # 174|Test 12%| test2.txt |543566677|HTTYE|9w5w …
Flatten a related table into a multiple columns with SQL
I’m trying to exact data from two tables in an IFS database (Oracle backend) using SQL. One table contains a list of Addresses, the other contains the Types those addresses have. Example: Address …
Why am I getting an Error with TADOQuery select statement?
Every time that I try to set the caption of this variable, it gives me “unspecified error” and I have concluded… I’ve tried to set the caption straight from the TADOQuery and by assigning the value …
Join two table with specific conditions in mysql
I have two table Table 1: (user) id,name,username,password table 2: (order) id,user,status status column have two value: 1(cancel order) or 2(success order) I want show all user list with order …
specific select within sql server
I have a table vbap : For all distinct POSNR, PARVW, I need to check if POSNR=POSNR2, if it’s the case I select KUNNR. if POSNRPOSNR2 and POSNR2 =’00000′ I select KUNNR Result: I didn’t …
Update jsonb column with value from row_to_json()
I have a table containing a data that look like: col1 col2 col3 col4 json_data —————————————————- a b c d {“mock”:”…