Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

Replace Expand / Collapse
Author
Message
Posted Wednesday, October 2, 2013 11:54 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 10, 2014 3:10 AM
Points: 1,134, Visits: 82
Instead of using replace use CASE WHEN ... THEN END syntex

like

and $filter = CASE WHEN CONDITION THEN 'VALUE' ELSE 'VALUE' END
Post #1500989
Posted Wednesday, October 2, 2013 11:55 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 10, 2014 3:10 AM
Points: 1,134, Visits: 82
Instead of using replace use CASE WHEN ... THEN END syntex

like

and $filter = CASE WHEN CONDITION THEN 'VALUE' ELSE 'VALUE' END
Post #1500990
Posted Wednesday, October 2, 2013 11:59 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, November 16, 2013 2:05 AM
Points: 17, Visits: 46
what this command will do?


whether it gives report for n timestamp(say 1h,one day like that)?

Thanks
Shobana
Post #1500995
Posted Thursday, October 3, 2013 12:02 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, November 16, 2013 2:05 AM
Points: 17, Visits: 46
With the help of my query can you add your CASE command and show me the query?

Thanks
Shobana
Post #1500996
Posted Thursday, October 3, 2013 12:10 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, November 16, 2013 2:05 AM
Points: 17, Visits: 46
ERROR: argument of AND must be type boolean, not type text.
LINE 1: ...aracter varying) where am.src='192.168.10.23' and replace('i...

when i run that query i am getting above error...............

its urgent

Can you help me out..............

Thanks,
Shobana
Post #1500998
Posted Thursday, October 3, 2013 12:11 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 10, 2014 3:10 AM
Points: 1,134, Visits: 82
Please provide me the condition on which your filter statement will be .

Lets say

condition 1
filter should be $filter = '1'
condition 2
filter should be $filter = '2'


then I can make the statement for you.

Thanks,
Post #1500999
Posted Thursday, October 3, 2013 12:13 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, November 16, 2013 2:05 AM
Points: 17, Visits: 46
we go with condition 1..


Thanks
Shobana
Post #1501001
Posted Thursday, October 3, 2013 12:18 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 10, 2014 3:10 AM
Points: 1,134, Visits: 82
Hi,

Sorry you didn't understood my question.

Just provide me original query and let me know what condition you want there in "Where" condition then I can help you.

Thanks,
Post #1501002
Posted Thursday, October 3, 2013 1:22 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, November 16, 2013 2:05 AM
Points: 17, Visits: 46
select distinct split_part(split_part(cp.msg, 'src=',1),',',1),split_part(split_part(cp.msg, 'user=''',2),',',1) as user ,am.itime,am.dtime,am.url from "FGT60B3908669009-wlog-1380091698" am join "SYSLOG-C0A80A41-glog-1380347892" cp on cast(am.src as character varying)=cast((split_part(split_part(cp.msg, 'src=',2),',',1) ) as character varying) where am.src='192.168.10.23' and replace('$filter', 'itime', 'am.itime')


This is my original query.................

Thanks,

Post #1501025
Posted Thursday, October 3, 2013 1:55 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Tuesday, June 10, 2014 3:10 AM
Points: 1,134, Visits: 82
Ok what you actually trying to do by this:

replace('$filter', 'itime', 'am.itime')

?

It may be some condition like itime>=something or item<=something right ?
Post #1501036
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse