Skip to content

Tag: mysql

Select updated rows in mysql

Is there simple way to select updated rows? I’m trying to store timestamp each time I am read row to be able to delete data that was not readed for a long time. First I tried execute SELECT query first and even found little bit slow but simple solution like but I still want to find a normal way to

Having trouble with WHERE DATEDIFF in my SQL

I think I’m going about this wrong. I want to pull the rows in my database that are less than a day old, in PHP. I’m using Laravel, but that’s not relevant. Here is what I have: However, that isn’t return the right results. It’s return results older than a day. Answer This query …

MySQL Error 1264: out of range value for column

As I SET cust_fax in a table in MySQL like this: and then I insert value like this: but then it say `error 1264` out of value for column And I want to know where the error is? My set? Or other? Any answer will be appreciated! Answer The value 3172978990 is greater than 2147483647 – the maximum value for

SELECT id HAVING maximum count of id

Have a products table with item_id and color_id. I’m trying to get the color_id with the most non-null instances. This fails: with This Returns I am looking for color_id 3, which has the most instances. Is there a quick and easy way of getting what I want without 2 queries? Answer This will give you the…