I have a MySQL query for example: My table only have qty and filedatetime columns. Based on this query is it possible to query out the following conditions: if filedatetime is filedatetime >= ‘2019-08-01 06:30:00’ and filedatetime < ‘2019-08-01 18:30:00’ then assign value ‘Day’ to column shift assign value ‘2019-08-01’ to column shiftDate if filedatetime >= ‘2019-08-01 18:30:00’ and filedatetime
Tag: mysql
the select convert function not working ! Return the syntax error?
I am using DBeaver. Here is my piece of code: This is the error: [42601]: ERROR: syntax error at or near “,” Because the data is too specific to extend of hour and minute so I want to change it. Not extract details out of it. Please help or at least give me another solution. Answer The CONVERT function is
How can I get the information from one field in a query to use in another query?
I am still trying to finish fixing my details page and I need one more piece to fix it. I start with this query. NOTE:recordID actually comes in from the previous page by clicking an item. Also, name, img, item_code, and type_id are fields in my table not outside sources. Now, I have created this to determine how to display
SQL – get distinct values and its frequency count of occurring in a group
I have a table data as: The data set is as follows: I need to list all distinct search_product_result values and count frequencies of these values occurring in s_product_id. Required Output result-set: Here, A occurs in three s_product_id : 0, 1, 2, B in two : 0, 2, and so on. D occurred twice in the same group 3, but
I have problem to use like and where clause together in sql
I want to select data from the SQL table and fetch data from the table with the use of LIKE and BETWEEN clause together and I have tried below query. but it shows me the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
Weird behavior with MySQL GroupBy on multiple columns
I am writing a query that groups a table of users by (height, sex) and then gets the name of the user with the minimum weight for that combination of height and sex. If you wanna skip to the actual query, here is the SQLFiddle with a minimal representative example. If you don’t want to open that url, here is
Not able to arrange data in descending order using sql
I have created the above table on SQL workbench and trying to run a very basic query of giving the data in desc order according to salary (code shown below along with output) however I am not getting …
Is there a way to calculate total breaks time in between first_check_in and last_check_out?
MySQL version is 8.0.16 I want to obtain the total break time for a given date the table is as follows: id | employee_id | check_in | check_out ——————————-…
Merge Multiple Queries Into 1 Query – On the same Row
I have 1 table called itemmovement : It has Item Id , Quantity In , Quantity Out , Invoice Id, Date. I need to make in one query to show how many pieces are sold and beside the sold column there will …
configure query to bring rows which have more than 1 entries
How to get those entries which have more than 1 records? If it doesn’t make sense… let me explain: From the below table I want to access the sum of the commission of all rows where type is joining …