In my MySQL database I have defined a function called isUserVerified that return the status of a user. I am trying to use the function in a SQL statement: SELECT id, isUserVerified(id) AS …
Tag: mysql
How to display the name of a supervisor for a certain worker MYSQL
Display the name of McLester’s supervisor. Using standard syntax select sup.lastname “Supervisor’s Name” from staff e, staff sup where e.supervisorno = sup.staffno and lastname = ‘McLester’; Here is …
SQL query assigment
1) Query that returns all agents who had sales greater or equal than 20 in month March, also sum of sales in month March greater or equal than 20 and number of sales in month March greater or equal …
SQL query to get minimal sum value and associated column from table
I have following tables: t1 – Items | Id | Item | | 1 | I1 | | 2 | I2 | t2 – Item_elements | Id | Item_id | Element | Our_quantity | Client_quantity | | 1 | 1 | E11 …
mysql query between days and calculate days between dates
i need to get the id and days count between days. my query is i need output as please help me. Answer GREATEST returns max value from list, LEAST – min
How to set and use variable in a trigger?
I’m creating a trigger in MySQL that should set a variable and use it to update a table. But i can’t find the right syntax to make this work. This is what i tried: CREATE TRIGGER …
With MySQL, how to calculate a MEDIAN with Left Join records?
Given the following two tables, I’d like to know how to calculate the MEDIAN rating for reviews on a weekly basis. reviews (id, user_id, completed_at) reviews.completed_at — lets us know the user …
Best way to store attendance and get difference of time in MySQL?
I’m very new to the SQL language and MySQL. I’m working on a little Time and Attendance application IN PYTHON. What it does is logs the clock in and out time. Then calculates the hours worked and …
how to delete rows where a single column value is duplicated
I need to remove all rows having duplicated title column. Something like: delete from clients where title is duplicated For example, if five rows have the same title column – four of them shold be …
I got mysqli error 1064 but i don’t know why
I want to post this data from android client and i tested it with postman and status code was 200. But i have a mysqli error and it’s: Error: ((1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘WHERE id=&#…