Skip to content
Advertisement

Tag: mysql

sql join without intermediate table (old database)

I’m working with a really old database and I’d like to do a simple join. Unfortunately, there is no intermediate table and it’s not possible to implement it in the near future (I know it’s really bad). The tables look like this: Expected result (for tbl_1.id = 1) How can I achieve that? I tried (didn’t work): This works but

Compare rows in one table with MySQL

I tried to compare rows in one table that I have. The table is like this: table I have 3 rows for comparing, and they had tp 1,2,3 for each one with the same fid and different id. The question is, how can I compare three of them to return? For example, more explanation For example, if ct of the

Converting PostgreSQL to MySQL

I am following a tutorial on how to find recurring transactions in a bank statement dataset. I have all the data needed, but I have issues getting the queries to work with MySQL. Any idea on how to convert this to MySQL? The error is: Update I adjusted the SQL query based on feedback, and providing example data. Now I’m

MySQL automatic apostrophes any ideas?

Im trying to patch a value in my Database, but Im getting an error. Backend: Frontend: Error: “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 ”important’ = 1 WHERE todo_id = 1′ at line 1″ SQL after processed: sql: “UPDATE posts SET ‘important’

SQL: Why do I not get the same output with the two queries below?

I am trying to find Students who got all possible different grades. If you receive an 18 you pass the course and the highest number is 30. Thus, if you have received 13 different grades which are higher than 17 you have in turn received all possible passing grades. The first query returns 0 rows and the second one returns

How to combine two queries? MySQL

How can i combine my two queries? 1: This query is finding dialogs where more than 10 messages and lasted more than an hour. 2: The second query selects two last rows for each dialogs. So, what i want is select last two rows for each dialogs that lasted more than an hour and where more than 10 messages. I

Advertisement