GROUP BY .. WITH ROLLUP
could get you something like that.

Otherwise, I would advise that you use your application language (PHP, Java, 
etc) to do "presentation" type stuff.

Yes, it could be done is SQL, but my brain might explode if I try to conjure up 
such.

> -----Original Message-----
> From: Larry Martell [mailto:larry.mart...@gmail.com]
> Sent: Monday, December 17, 2012 5:18 AM
> To: mysql mailing list
> Subject: blank line when column changes
> 
> I have this query:
> 
> SELECT q1.t, data_eventlog.message, q1.dt, data_eventlog.date_time FROM
> (SELECT cdsem_event_message_idx.message m,
>              cdsem_event_message_idx.date_time dt,
>              data_tool.name t,
>              cdsem_event_message_idx.tool_id tid
>       FROM data_tool, cdsem_event_message_idx
>       WHERE data_tool.id = cdsem_event_message_idx.tool_id
>       AND cdsem_event_message_idx.message_idx = 'ExitingToOn') q1,
> data_eventlog WHERE data_eventlog.date_time <= q1.dt AND
> TIMESTAMPDIFF(SECOND, data_eventlog.date_time, q1.dt) < 120 AND
> data_eventlog.tool_id = q1.tid ORDER BY q1.t, q1.dt,
> data_eventlog.date_time
> 
> What I want to do is output a blank line whenever (q1.t, q1.dt)
> changes. Is there any way to do that in SQL?
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql

Reply via email to