Re: time stamp specific to columns

2015-04-09 Thread hsv

On 2015/04/08 11:42, Andrew Wallace wrote:

I think you'd have to do that with a trigger.


Yes, one can do that with a trigger, but it is a real pain. MySQL now allows
(new.a,new.b,new.c,new.d) <> (old.a,old.b,old.c,old.d)
but one needs to beware of NULL. Maybe it is better to split off the 
timestampy part to another table, and join them when needed.



On 4/8/15 6:36 AM, Martin Mueller wrote:

I understand how a timestamp column automatically changes when there is a
change in a data row. Is it possible to limit the update to changes in
particular columns? I have a table where I care about changes in any of
four different columns, but I don¹t care about changes in other
columns or
added columns.

Is there a command that says ³update the time stamp if and only if there
is a change in columns a, b,c, or d"


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



Re: time stamp specific to columns

2015-04-09 Thread Michael Dykman
A trigger is far simpler than remodelling your data and adding extra
queries.  They are nothing to be afraid of.

On Thu, Apr 9, 2015 at 10:46 AM,  wrote:

> On 2015/04/08 11:42, Andrew Wallace wrote:
>
>> I think you'd have to do that with a trigger.
>>
>
> Yes, one can do that with a trigger, but it is a real pain. MySQL now
> allows
> (new.a,new.b,new.c,new.d) <> (old.a,old.b,old.c,old.d)
> but one needs to beware of NULL. Maybe it is better to split off the
> timestampy part to another table, and join them when needed.
>
>
>  On 4/8/15 6:36 AM, Martin Mueller wrote:
>>
>>> I understand how a timestamp column automatically changes when there is a
>>> change in a data row. Is it possible to limit the update to changes in
>>> particular columns? I have a table where I care about changes in any of
>>> four different columns, but I don¹t care about changes in other
>>> columns or
>>> added columns.
>>>
>>> Is there a command that says ³update the time stamp if and only if there
>>> is a change in columns a, b,c, or d"
>>>
>>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/mysql
>
>


-- 
 - michael dykman
 - mdyk...@gmail.com

 May the Source be with you.


Re: store search result as new table in memory

2015-04-09 Thread Lucio Chiappetti

On Tue, 7 Apr 2015, shawn l.green wrote:


Temporary tables are going to become your very good friends.


yes I do use temporary tables a lot

The advantage to using temporary tables is that they can have indexes on 
them. You can create the indexes when you create the table or you can 
ALTER the table later to add them.


if they are big, using proper indices is a must to get quick responses.

--

Lucio Chiappetti - INAF/IASF - via Bassini 15 - I-20133 Milano (Italy)
For more info : http://www.iasf-milano.inaf.it/~lucio/personal.html

Do not like Firefox >=29 ?  Get Pale Moon !  http://www.palemoon.org

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