I am working on a site that will be used to clean up inactive Tableau workbooks. Logging into this site will allow my users to see their old workbooks and decide which ones to keep. This is going to …
Tag: mysql
Laravel SQL Query. Help me
I have a table name “Offers” with 3 (public, request, private ) types of data. Now I want to show directly to the user end public and request offers. and private offers not be shown but when admin …
SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens – help needed
I’ve tried making a website which has a database connected to it and I’m getting the error message below SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens This is my PHP code that I have written below Answer It took me a while to find, but I belie…
Simple SQL query returning null value
I just started studying SQL queries. I am practicing on this site: https://www.techonthenet.com/sql/joins_try_sql.php I want to find: “the name of the employee with the highest salary for every department”. My query is: And I get null value for first_name : I understand that the problem is due to …
How can I optimise COUNT with GROUPBY mysql query?
I have 5M records in eus table and 121 records in es table. I am doing a left join but the COUNT query is making my query very slow. How can I optimize this? public static function …
Pairing table query
I was wondering how I construct a query to get all articles with all their information, and for every article a list with their tags. I used a pairing table called ArticleTags to connect Article and Tags. Can anyone tell me what the query would be if I wanted to receive all articles along with their tags per …
MySQL self join to find only the next revision
Actually I’m working with WordPress. I want to create a self-join or something similar to find a revision of a post, and the following revision of the same post. https://www.db-fiddle.com/f/eHnwYABYrVVQAhn8xLJ77q/1 The previous query doesn’t work since it takes, for every record of a, all the revi…
How to compare a value within a range, inside (case when ~~ end as) query for mysql?
this is what I got: and I want to change this part as, for now I get the raw data of rssi, for example any digits between 0 and 120.. but now I want to change the rssi result if the data is in between certain range. For example, if rssi is between 0 and 20, its 1. if its
How to SELECT DISTINCT *
Is this a possible query? Currently, every product from my database is being listed on the home page of my website and a lot of them are duplicates since a product can belong to multiple categories. I am using “SELECT * FROM Books WHERE product_status = ‘1’”; Answer Then use group by a…
Create query to get count of uncompleted calls
There is table waiter_log as Call with call-id ‘f27de4f’ started in 9010 and finished in 9003 because there is a record with proceed_wait = 0 for call-id=’f27de4f’ Call with call-id ‘asdf231′ started in 9010, still proceed in 9002 and not finished yet because there is no re…