I want to create a query, that will show the word “Passed” if the DATEDIFF(so_date,actual_delivery) = 3 then show “Failed” if not. Can someone help me please?
Tag: mysql
Making a custom table from one table
My table is called Storage_Tot which has date, tagid, value components. Below are the two tables (Table A and Table B) I created using SQL query. I essentially ran same query with different tagid …
SQL statement: how can I pick a value only once from a table to update another table?
I wish to update table1 with any distinct value of table2 matching the same code, no matter which one or the order (value from table2 can’t be picked more than once) +——————-+ +——…
Mysql find_in_set of array separator
I have column user_orders we are storing like [1][2][3][5] // Expected output 1,2,3,5 [25][27] // Expected output 25,27 [2] // Expected output 2 I don’t understand why my master …
SQL: Update all rows except one of each group
I have a table like this. Column “Mail sent” has either the values “0” or a date. +————-+—————–+————+ | Ordernumber | Email | Mail sent | +————-+———…
MySQL – surrounding precomputed variable with single-quotes prior to inserting
The primary key of my table is a char of fixed length 11. I have precomputed the key in my script, just like this: SET pes = LPAD(person_number, 11, ‘0’); Now, my variable meets my critera. It only …
Select consecutive rows under a certain value in MySQL
Selecting consecutive rows with a column under a certain value I have a table with the following data: crashID crash ———————– 1 189 2 144 3 8939 …
How to Join Two tables records in mysql
I want to join two tables , booking table id from_branch to_branch 1 2 4 2 3 4 Branch Table id name 1 pune 2 mumbai 3 nanded 4 parbhani 5 …
How do you join multiple foreign keys?
I am creating a blog using PHP and SQL, I am trying to query everything in 1 SQL query so I can bring out all of the comments with the authors and all of the blogs with the authors. Each of them have …
MySQL – Select where first character is lowercase or uppercase
Sorry if this is something that was asked before, but I am not able to find the answer to this. How do I create a MySQL select statement to select all strings from the database whose first characters …