I am really lost with sql.. i tried to read everything but no luck. I have two tables and need to retrieve data from them: First Table – Workers | Second Table – Stores Select workers first name that belong to more than one store? Select all workers first name that are in the shoe store? Hope you …
Tag: mysql
MySQL: How to hold lock and make other threads wait for an insert that hasn’t happened yet
I’m confronted by a seemingly simple problem that has turned out to be pretty hard to figure out. We want to keep a record of every time we’re presented with a piece of marketing (a lead) so we don’t …
Support needed for a query
I need help to finish a SQL Query for a Woocommerce product list. I need this for a wpdatatable sql input. I searched for a example code and have adapted a found code: SELECT p.ID, p.post_title, …
I have been looking for solution to get sum of multiple columns(for a single row) in Mysql to get total of every hour for electricity invoice?
I wrote below query to get sum but it is showing(something progressing) total as null for couple of records. It is showing 1064 error at line 4 when I include all records like below. Answer it is showing total as null for couple of records Probably, at least one of the columns has a null value for those recor…
How to query the count of two fields by two different clauses at the same time?
I want to query for a count of a WHERE clause 1 and another count of WHERE clause 2. I have a simplified query result for my booking app: I want to 3 columns in total, first being a field called Token, second the count of Pending grouped by renter, and finally the count Overdue field grouped also by renter.
Move the clicked element to first
I am working on a query where I need to find all the employee names whose salary is less than the other employee salaries. In output I need two columns, the names of both the employees. for example: …
SQL multiple values in Where = “N”
I am going to execute SQL command on my multiplayer game, I don’t wanna any game stop or something like that because I am going to lose players so everything must go smooth. Its my command : UPDATE `…
How to calculate count of each value in MySQL JSON array?
I have a MySQL table with the following definition: mysql> desc person; +——–+———+——+—–+———+——-+ | Field | Type | Null | Key | Default | Extra | +——–+———+-…
TRIGGER that checks if that delete removes all the table values
Basicly I just don’t wanna allow that DELETE FROM X delete ALL rows. For example: DELETE FROM X WHERE ID = 3 OR ID = 4; –> Allowed because don’t try to remove all table. DELETE FROM X; –> Not …
This script won’t run on PHPmyadmin. Neither will any others [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 2 years ago. Improve this question When trying to run this script or any script on PHPmyadmin, it shows …