That is what I am here for!
Ronald :cool:
That is what I am here for!
Ronald :cool:
Hi Ronald;
How are you ?
I have 3 rather Long Questions that are causing alot of trouble:
I would appreciate your help since i have had a really hard time, and tried to use ur last post to atli to help but it did not help...
!) I have an events table, within the events table I have 7 columns,
Alias varchar (30)
Progress int(1)
Val double
Stamp timestamp
ID auto increment.
date date
time time
My problem is very similar to Atli, where he wanted to perform a mysql if statement on the result of a count function.
Basically, My progress column is intented to hold a '1' or a '0'
so here we go....
if the result of the count of occurance Alias = 'Test' modulus 2 (i.e. count(Alias) mod 2)
is equivelant to '0', then we wish to input a '1' into the 'progress' column of my 'events' table, if the result of count(Alias) mod 2 where Alias = 'Test' equals '1' then i would like to put in a '0' into my 'progress' column of my 'events' table.
This process must happen every time that a record is entered with the Alias = 'Test' - so that probably means that we need to put it in a trigger of some sort.
Also is there a way for replacing Alias = 'Test' for Alias = 'select distinct alias from events'????? so that we have something like this:
Select count(Alias) mod 2 from events where Alias = Select distinct Alias from events. and then enclose that in an if statement and then a trigger.
This 2nd query is ideally what we would like because my table could potentially hold 1000 records or even more.
thankyou
2) in the same 'events' table i have a stamp column, holding a timestamp that has been inserted into my table, what i need to do is, to get what ever is in the stamp column, and cut it into time and date, the way i thought would be good was to insert that value into the date and time columns that are in my events table????
and again this would have to be for every row in my table, and every newly inserted row, and would therefore require a trigger....could you help me out at all?
this has also given me a huge hadache.
one Last Question: will the trigger come into action every time the MYSQL server instance is initialised, you see everything is local at the moment on my laptop, and is configured so that the instance starts upon boot, will that mean that the triggers will also come into play asap?
Thankyou very much for your help in advance - this is very urgent and i have been bouncing my head of walls for days.
I really appreciate your time and effore
imran