Within-group aggregates with another wrinkle.

Recently when optimising an SQL query I needed to return a specific subset of records from a large table. The brilliant Common Queries Tree pointed me in the right direction, but the examples didn’t quite cover my specific case. I needed the records with the maximal value of x and the minimal value of y … Read more

MySQL: Row N was truncated; a solution

You’re importing some data into MySQL and using LOAD DATA INFILE so you can do a SHOW WARNINGS afterwards. Every line of your import file has a warning: | Warning | 1262 | Row 1 was truncated; it contained more data than there were input columns | Warning | 1262 | Row 2 was truncated; … Read more