first and foremost , yes im using SQL. only SQL query language. I am using MYSQL workbench to extract some features needed for my project. I have managed to extract the features needed and store it in a new table call new event. I have also converted the time into integer. Below is the sql code used :-
select iphdr.cid ,iphdr.ip_dst, date(event.timestamp), convert(time(event.timestamp), unsigned) as newtime, event.signature
from iphdr, event
where iphdr.cid = event.cid
order by event.signature;
result (some of the output)
cid | ip_add | date | time | signature
480 | 3232284675 | 2011-11-19 | 4328 | 1
482 | 3232284675 | 2011-11-19 | 4328 | 1
1 | 3232284675 | 2011-11-19 | 113928 | 1
2 | 3232284675 | 2011-11-19 | 235959 | 2
Since I have converted the time into numeric; hence newtime, now i need to segregate the output form the query above into three different time frame (time frame 0 , 1 and 2). Here is the problem .... when i try to do it using the codes i posted previously i keep getting the 1064 error code. I thought that by using IF then Else , i could easily separate the data into 3 different time frame.
The output i need is like below
cid | ip_add | date |time | sig.|timeFrame
480 | 3232284675 |2011-11-19 |4328 | 1 | 0
482 | 3232284675 |2011-11-19 |4328 | 1 | 0
1 | 3232284675 |2011-11-19 |113928 | 1 | 1
2 | 3232284675 |2011-11-19 |235959 | 2 | 2
the code i used earlier (with 1064 error code) was suppose to do that.
I hope im making more sense now. Im a complete klutz when it comes to programming. im sorry .
Im also trying to make this work by browsing the net. Ill be working hard while waiting for your reply.
thank you .