A while back I presented SQL: selecting top N records per group, a "give me the top 5 countries in each continent" type of query, and which used an external numbers table and a lot of tedious casting. Here's another solution I came up with (*). Still using GROUP_CONCAT (how else?), but no external table […]
Problem: you wish to write table data to file, but you wish to do so on client side. SELECT ... INTO OUTFILE writes the file on server. What are your options on client? 1. mysql client If you have direct access from your client machine to your DB server machine, and can connect via mysql […]
I'm doing a lot of stored routine programming lately, working on common_schema. I'm in particular touching at the extremes of abilities. Some things just can't be done from within a stored routine. Here's a list of can't be done: Cursor for SHOW statements: can't be done -- this is explicitly blocked from operating (it once […]