Skip to content

Tag: mysql

MySQL SELECT from 2 tables get newest records

I have a problem with query. My database tabels: FIRST TABLE SECOND TABLE For example like a Post and comments. I want newest comment in post. Expected Output: My query OUTPUT: I tried with MAX(date_add) but don’t work or I do it something wrong Answer You can use a subquery with MAX() aggregation for d…

Find rows using in between values in MySQL

I found it really hard to come up with a descriptive problem title, so I’ll give a bit of context. We have a list of boats and a list of docks. Boats can be transferred from one dock to the other on a specific datetime, or it could be at no dock at all. I’m trying to find out which

Can I use Where Clause like this for my query.. help me [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question Answe…