List:General Discussion« Previous MessageNext Message »
From:Larry Martell Date:December 18 2012 10:52pm
Subject:Re: blank line when column changes
View as plain text  
Yeah, it's easy enough to do in python, but my client wanted a SQL query.

Thanks


On Tue, Dec 18, 2012 at 5:48 PM, Rick James <rjames@stripped> wrote:
> 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.martell@stripped]
>> 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
>
Thread
blank line when column changesLarry Martell17 Dec
  • RE: blank line when column changesRick James18 Dec
    • Re: blank line when column changesLarry Martell18 Dec