Re: mysqldump with single-transaction option.

2014-10-08 Thread Andrew Moore
We will tend to use binary backups (Xtrabackup) for full consistent dataset restore (think slave provisioning and disaster recovery) and logical backups to perform single table restores in the event that a rollback may need to occur if someone drops a table or carries out an insane update. We will

Re: Need a short directive

2014-10-08 Thread Trianon 33
A big thanks to Johan, who pointed me in the right direction. I had indeed to fix a where clause, but in the end al went very well. BR, hans. Johan De Meersman schreef op 07-10-14 om 16:10: - Original Message - From: Trianon 33 triano...@gmail.com Subject: Need a short directive

Query with variable number of columns?

2014-10-08 Thread Jan Steinman
I often use CASE WHEN ... to pivot tables. For example, splitting sales data by year: SELECT s_product.name AS `Product`, SUM(CASE WHEN YEAR(sales.Date)='2007' THEN sales.Total ELSE NULL END) AS `2007`, SUM(CASE WHEN YEAR(sales.Date)='2008' THEN sales.Total ELSE NULL END) AS

Re: Query with variable number of columns?

2014-10-08 Thread Peter Brawley
On 2014-10-08 1:38 PM, Jan Steinman wrote: I often use CASE WHEN ... to pivot tables. For example, splitting sales data by year: SELECT s_product.name AS `Product`, SUM(CASE WHEN YEAR(sales.Date)='2007' THEN sales.Total ELSE NULL END) AS `2007`, SUM(CASE WHEN

Re: Query with variable number of columns?

2014-10-08 Thread hsv
2014/10/08 11:38 -0700, Jan Steinman However, this pattern will often result in numerous empty columns -- empties that would not be there had the table not been pivoted. 2014/10/08 16:42 -0500, Peter Brawley MySQL stored procedures are less incomplete, and can do it, but they're awkward.