database table_img for better understanding Pardon me for weak English writing my sql query that i am getting value,low_value,high_value and limit_exceded_. issue is in limit_exceded to not get correct values, it shows all 0. I want to get int 1 in front of those values whose value is less than 40 or greater …
Tag: mysql
Compare Existence Of The Same Field A Based On Field Batch [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question A table has fields code batch I want to know what code(s) are in batch 1 but not in batch 2. …
What kind of join should I implement in order to receive the output I am trying to get?
NOTE: Just a practice problem.. NOT looking for free homework answers. The practice problem I have asks to report the number of flights by plane’s year in ascending order of plane’s year. This requires the joining of two tables, the flights table and planes table. I believe the SQL should be relatively simple…
SQL: Select certain rows with window functions in MySQL/MariaDB
My problem can be simplified to the following example: Now I’m looking for an sql statement which selects all rows (ordered by dfrom) having a dfrom not between the dfrom and dto of any previously selected row, possibly using window functions to get informations on other rows, like this: resulting in: C…
How to set pdo timezone at connection
I have this code where I connect to database and the code is working properly. However the now() function of MySQL is out of sync with PHP set default time zone function. I am comparing the PHP date with MySQL now. Therefore, I wanted to set the database time zone as well. I wanted to set the database time up…
How can I use select count (distinct x) in order to count two values in the same table and get the the two distinct values in my output?
I am trying to use count (distinct) in order to count the number of distinct values for two different values in the same table. The output I am trying to get should have both of the distinct values as …
Is there a way to order by value increase compared to older entries in MYSQL?
I want to order each ID by the percentage increase in a three day timeframe. If there is no entry three days ago, it should move up the date until today’s date. In the following I have explained the …
Counting unique pairs, but applying that count to all of its entries in SQL (not removing duplicates)
Let’s say I have a table: And I want my table output to be: but with the code I have here my output looks like this Any way I can create an sql query to is like my top table vs the one I make currently Using: 10.5.5-MariaDB Answer Use window functions:
Sql query to get row from date filled
I want to get data from training_course table where current date minus 5 days is equal to training_end_date. Training_end_date is my field in the table. Thanks Answer You seem to want: Or, if your dates have time components, you maybe want:
PHP (v5.6) Error Uncaught exception ‘mysqli_sql_exception’ with message ‘Access denied for user [closed]
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 y…