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 2 years ago. Improve this question The question is as follows : My question is regarding SQL code for the following question. F…
Tag: mysql
SQL Weighted averages of multiple rows –
How would you go about to find the real weighted average of multiple rows: By real weighted, I mean like this calculator: https://www.rapidtables.com/calc/math/weighted-average-calculator.html (and not by multiplying value with weight). The weight for each answer is set in answers and values for each question…
My query to retrieve events between 2 search dates does not return any results, why?
Context I have modelized a calendar with a table. The entries are the calendar’s events: id ; event_start_date ; event_end_date. One entry is: 11 ; 2021-01-28 15:15:37 ; 2022-01-11 15:15:37 The script I’ve written accepts a search interval of dates as entries and should return all the events which…
LIKE statement SQL
Dont work brackets in LIKE statement I use MySQL WorkBench, I dont understand why SELECT * from user where name like’B[io]’ dont work. My DataBase: Answer Because MySQL does not support character classes in like expressions. Neither does the SQL standard. Use regular expressions: Incidentally, the…
error on MySQL when i add month to the query [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 last year. Improve this question I have a dataset including a endDate and a startDate: endDate startDate…
How to insert database mysql. Solve?
How can I insert the file data into the table mysql? code: import pymysql.cursors import pymysql as MySQLdb import pymysql from Bio import SeqIO try: conexao = MySQLdb.connect(host=”…
How to count each value with the same id in sql
I have a table like this How can I get the count of all values with Poll_id = 1 so I can get using sql Answer Use group by with where:
Joining three junction tables
my heads hurt from trying to figure this out! I have three tables -Players -Teams -Games Three junction tables with two columns. -player_teams -teams_games -player_games I need to list all Players who …
Get three last movements of the per ID with LAG and GROUP BY in MySQL
I hope someone can help with this query, I have a requirement for a query that groups the id of the last date, but I want to have three columns with the 3 last movements. So I tried grouping by the id and used MAX(date), and used LAG to get the three last movements, but I’m getting an error from
SQL : Keep ONE row with max value on a column depending on value of another column
It’s well documented on StackOverflow how to find the whole data for the row with some max value in a column per some group identifier (SQL select only rows with max value on a column). But that given …