I have 3 rather Long Questions that are causing alot of trouble:
I would appreciate all the help i can get and tried to use A post sent to atli in the past but it did not help...
!) I have an events table, within the events table I have 7 columns,
Expand|Select|Wrap|Line Numbers
- Alias varchar (30)
- Progress int(1)
- Val double
- Stamp timestamp
- ID auto increment.
- date date
- time time
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
Expand|Select|Wrap|Line Numbers
- Alias = 'Test'
Expand|Select|Wrap|Line Numbers
- Alias = 'select distinct alias from events
Expand|Select|Wrap|Line Numbers
- 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.
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....coul d someone 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? (OS:windows xp 32 bit)
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 effort, may god help you all!
imran
Please Also send reply to:
xxxxxxx@yahoo.c om
thanks again