HELP~~ how to optimize this?!?

hello...
Been cracking my head over this set of 'if...else' statements
is there anyway to further optimise the codes to make it more efficient?
if ( (a == u && b == v && c == w && d == x && e == y && f == z )){ bExist = true; break;}
else if ( (a == u && b == v && c == w && d == x && e == z && f == y )){ bExist = true; break;}
else if ( (a == u && b == v && c == w && d == y && e == x && f == z )){ bExist = true; break;}
else if ( (a == u && b == v && c == w && d == y && e == z && f == x )){ bExist = true; break;}
else if ( (a == u && b == v && c == w && d == z && e == x && f == y )){ bExist = true; break;}
else if ( (a == u && b == v && c == w && d == z && e == y && f == x )){ bExist = true; break;}
else if ( (a == u && b == v && c == x && d == w && e == y && f == z )){ bExist = true; break;}
else if ( (a == u && b == v && c == x && d == w && e == z && f == y )){ bExist = true; break;}
else if ( (a == u && b == v && c == x && d == y && e == w && f == z )){ bExist = true; break;}
else if ( (a == u && b == v && c == x && d == y && e == z && f == w )){ bExist = true; break;}
else if ( (a == u && b == v && c == x && d == z && e == w && f == y )){ bExist = true; break;}
else if ( (a == u && b == v && c == x && d == z && e == y && f == w )){ bExist = true; break;}
else if ( (a == u && b == v && c == y && d == w && e == x && f == z )){ bExist = true; break;}
else if ( (a == u && b == v && c == y && d == w && e == z && f == x )){ bExist = true; break;}
else if ( (a == u && b == v && c == y && d == x && e == w && f == z )){ bExist = true; break;}
else if ( (a == u && b == v && c == y && d == x && e == z && f == w )){ bExist = true; break;}
else if ( (a == u && b == v && c == y && d == z && e == w && f == x )){ bExist = true; break;}
else if ( (a == u && b == v && c == y && d == z && e == x && f == w )){ bExist = true; break;}
else if ( (a == u && b == v && c == z && d == w && e == x && f == y )){ bExist = true; break;}
else if ( (a == u && b == v && c == z && d == w && e == y && f == x )){ bExist = true; break;}
else if ( (a == u && b == v && c == z && d == x && e == w && f == y )){ bExist = true; break;}
else if ( (a == u && b == v && c == z && d == x && e == y && f == w )){ bExist = true; break;}
else if ( (a == u && b == v && c == z && d == y && e == w && f == x )){ bExist = true; break;}
else if ( (a == u && b == v && c == z && d == y && e == x && f == w )){ bExist = true; break;}
else if ( (a == u && b == w && c == v && d == x && e == y && f == z )){ bExist = true; break;}
else if ( (a == u && b == w && c == v && d == x && e == z && f == y )){ bExist = true; break;}
else if ( (a == u && b == w && c == v && d == y && e == x && f == z )){ bExist = true; break;}
else if ( (a == u && b == w && c == v && d == y && e == z && f == x )){ bExist = true; break;}
else if ( (a == u && b == w && c == v && d == z && e == x && f == y )){ bExist = true; break;}
else if ( (a == u && b == w && c == v && d == z && e == y && f == x )){ bExist = true; break;}
else if ( (a == u && b == w && c == x && d == v && e == y && f == z )){ bExist = true; break;}
else if ( (a == u && b == w && c == x && d == v && e == z && f == y )){ bExist = true; break;}
else if ( (a == u && b == w && c == x && d == y && e == v && f == z )){ bExist = true; break;}
else if ( (a == u && b == w && c == x && d == y && e == z && f == v )){ bExist = true; break;}
else if ( (a == u && b == w && c == x && d == z && e == v && f == y )){ bExist = true; break;}
else if ( (a == u && b == w && c == x && d == z && e == y && f == v )){ bExist = true; break;}
else if ( (a == u && b == w && c == y && d == v && e == x && f == z )){ bExist = true; break;}
else if ( (a == u && b == w && c == y && d == v && e == z && f == x )){ bExist = true; break;}
else if ( (a == u && b == w && c == y && d == x && e == v && f == z )){ bExist = true; break;}
else if ( (a == u && b == w && c == y && d == x && e == z && f == v )){ bExist = true; break;}
else if ( (a == u && b == w && c == y && d == z && e == v && f == x )){ bExist = true; break;}
else if ( (a == u && b == w && c == y && d == z && e == x && f == v )){ bExist = true; break;}
else if ( (a == u && b == w && c == z && d == v && e == x && f == y )){ bExist = true; break;}
else if ( (a == u && b == w && c == z && d == v && e == y && f == x )){ bExist = true; break;}
else if ( (a == u && b == w && c == z && d == x && e == v && f == y )){ bExist = true; break;}
else if ( (a == u && b == w && c == z && d == x && e == y && f == v )){ bExist = true; break;}
else if ( (a == u && b == w && c == z && d == y && e == v && f == x )){ bExist = true; break;}
else if ( (a == u && b == w && c == z && d == y && e == x && f == v )){ bExist = true; break;}
else if ( (a == u && b == x && c == v && d == w && e == y && f == z )){ bExist = true; break;}
else if ( (a == u && b == x && c == v && d == w && e == z && f == y )){ bExist = true; break;}
else if ( (a == u && b == x && c == v && d == y && e == w && f == z )){ bExist = true; break;}
else if ( (a == u && b == x && c == v && d == y && e == z && f == w )){ bExist = true; break;}
else if ( (a == u && b == x && c == v && d == z && e == w && f == y )){ bExist = true; break;}
else if ( (a == u && b == x && c == v && d == z && e == y && f == w )){ bExist = true; break;}
else if ( (a == u && b == x && c == w && d == v && e == y && f == z )){ bExist = true; break;}
else if ( (a == u && b == x && c == w && d == v && e == z && f == y )){ bExist = true; break;}
else if ( (a == u && b == x && c == w && d == y && e == v && f == z )){ bExist = true; break;}
else if ( (a == u && b == x && c == w && d == y && e == z && f == v )){ bExist = true; break;}
else if ( (a == u && b == x && c == w && d == z && e == v && f == y )){ bExist = true; break;}
else if ( (a == u && b == x && c == w && d == z && e == y && f == v )){ bExist = true; break;}
else if ( (a == u && b == x && c == y && d == v && e == w && f == z )){ bExist = true; break;}
else if ( (a == u && b == x && c == y && d == v && e == z && f == w )){ bExist = true; break;}
else if ( (a == u && b == x && c == y && d == w && e == v && f == z )){ bExist = true; break;}
else if ( (a == u && b == x && c == y && d == w && e == z && f == v )){ bExist = true; break;}
else if ( (a == u && b == x && c == y && d == z && e == v && f == w )){ bExist = true; break;}
else if ( (a == u && b == x && c == y && d == z && e == w && f == v )){ bExist = true; break;}
else if ( (a == u && b == x && c == z && d == v && e == w && f == y )){ bExist = true; break;}
else if ( (a == u && b == x && c == z && d == v && e == y && f == w )){ bExist = true; break;}
else if ( (a == u && b == x && c == z && d == w && e == v && f == y )){ bExist = true; break;}
else if ( (a == u && b == x && c == z && d == w && e == y && f == v )){ bExist = true; break;}
else if ( (a == u && b == x && c == z && d == y && e == v && f == w )){ bExist = true; break;}
else if ( (a == u && b == x && c == z && d == y && e == w && f == v )){ bExist = true; break;}
else if ( (a == u && b == y && c == v && d == w && e == x && f == z )){ bExist = true; break;}
else if ( (a == u && b == y && c == v && d == w && e == z && f == x )){ bExist = true; break;}
else if ( (a == u && b == y && c == v && d == x && e == w && f == z )){ bExist = true; break;}
else if ( (a == u && b == y && c == v && d == x && e == z && f == w )){ bExist = true; break;}
else if ( (a == u && b == y && c == v && d == z && e == w && f == x )){ bExist = true; break;}
else if ( (a == u && b == y && c == v && d == z && e == x && f == w )){ bExist = true; break;}
else if ( (a == u && b == y && c == w && d == v && e == x && f == z )){ bExist = true; break;}
else if ( (a == u && b == y && c == w && d == v && e == z && f == x )){ bExist = true; break;}
else if ( (a == u && b == y && c == w && d == x && e == v && f == z )){ bExist = true; break;}
else if ( (a == u && b == y && c == w && d == x && e == z && f == v )){ bExist = true; break;}
else if ( (a == u && b == y && c == w && d == z && e == v && f == x )){ bExist = true; break;}
else if ( (a == u && b == y && c == w && d == z && e == x && f == v )){ bExist = true; break;}
else if ( (a == u && b == y && c == x && d == v && e == w && f == z )){ bExist = true; break;}
else if ( (a == u && b == y && c == x && d == v && e == z && f == w )){ bExist = true; break;}
else if ( (a == u && b == y && c == x && d == w && e == v && f == z )){ bExist = true; break;}
else if ( (a == u && b == y && c == x && d == w && e == z && f == v )){ bExist = true; break;}
else if ( (a == u && b == y && c == x && d == z && e == v && f == w )){ bExist = true; break;}
else if ( (a == u && b == y && c == x && d == z && e == w && f == v )){ bExist = true; break;}
else if ( (a == u && b == y && c == z && d == v && e == w && f == x )){ bExist = true; break;}
else if ( (a == u && b == y && c == z && d == v && e == x && f == w )){ bExist = true; break;}
else if ( (a == u && b == y && c == z && d == w && e == v && f == x )){ bExist = true; break;}
else if ( (a == u && b == y && c == z && d == w && e == x && f == v )){ bExist = true; break;}
else if ( (a == u && b == y && c == z && d == x && e == v && f == w )){ bExist = true; break;}
else if ( (a == u && b == y && c == z && d == x && e == w && f == v )){ bExist = true; break;}
else if ( (a == u && b == z && c == v && d == w && e == x && f == y )){ bExist = true; break;}
else if ( (a == u && b == z && c == v && d == w && e == y && f == x )){ bExist = true; break;}
else if ( (a == u && b == z && c == v && d == x && e == w && f == y )){ bExist = true; break;}
else if ( (a == u && b == z && c == v && d == x && e == y && f == w )){ bExist = true; break;}
else if ( (a == u && b == z && c == v && d == y && e == w && f == x )){ bExist = true; break;}
else if ( (a == u && b == z && c == v && d == y && e == x && f == w )){ bExist = true; break;}
else if ( (a == u && b == z && c == w && d == v && e == x && f == y )){ bExist = true; break;}
else if ( (a == u && b == z && c == w && d == v && e == y && f == x )){ bExist = true; break;}
else if ( (a == u && b == z && c == w && d == x && e == v && f == y )){ bExist = true; break;}
else if ( (a == u && b == z && c == w && d == x && e == y && f == v )){ bExist = true; break;}
else if ( (a == u && b == z && c == w && d == y && e == v && f == x )){ bExist = true; break;}
else if ( (a == u && b == z && c == w && d == y && e == x && f == v )){ bExist = true; break;}
else if ( (a == u && b == z && c == x && d == v && e == w && f == y )){ bExist = true; break;}
else if ( (a == u && b == z && c == x && d == v && e == y && f == w )){ bExist = true; break;}
else if ( (a == u && b == z && c == x && d == w && e == v && f == y )){ bExist = true; break;}
else if ( (a == u && b == z && c == x && d == w && e == y && f == v )){ bExist = true; break;}
else if ( (a == u && b == z && c == x && d == y && e == v && f == w )){ bExist = true; break;}
else if ( (a == u && b == z && c == x && d == y && e == w && f == v )){ bExist = true; break;}
else if ( (a == u && b == z && c == y && d == v && e == w && f == x )){ bExist = true; break;}
else if ( (a == u && b == z && c == y && d == v && e == x && f == w )){ bExist = true; break;}
else if ( (a == u && b == z && c == y && d == w && e == v && f == x )){ bExist = true; break;}
else if ( (a == u && b == z && c == y && d == w && e == x && f == v )){ bExist = true; break;}
else if ( (a == u && b == z && c == y && d == x && e == v && f == w )){ bExist = true; break;}
else if ( (a == u && b == z && c == y && d == x && e == w && f == v )){ bExist = true; break;}
else if ( (a == v && b == u && c == w && d == x && e == y && f == z )){ bExist = true; break;}
else if ( (a == v && b == u && c == w && d == x && e == z && f == y )){ bExist = true; break;}
else if ( (a == v && b == u && c == w && d == y && e == x && f == z )){ bExist = true; break;}
else if ( (a == v && b == u && c == w && d == y && e == z && f == x )){ bExist = true; break;}
else if ( (a == v && b == u && c == w && d == z && e == x && f == y )){ bExist = true; break;}
else if ( (a == v && b == u && c == w && d == z && e == y && f == x )){ bExist = true; break;}
else if ( (a == v && b == u && c == x && d == w && e == y && f == z )){ bExist = true; break;}
else if ( (a == v && b == u && c == x && d == w && e == z && f == y )){ bExist = true; break;}
else if ( (a == v && b == u && c == x && d == y && e == w && f == z )){ bExist = true; break;}
else if ( (a == v && b == u && c == x && d == y && e == z && f == w )){ bExist = true; break;}
else if ( (a == v && b == u && c == x && d == z && e == w && f == y )){ bExist = true; break;}
else if ( (a == v && b == u && c == x && d == z && e == y && f == w )){ bExist = true; break;}
else if ( (a == v && b == u && c == y && d == w && e == x && f == z )){ bExist = true; break;}
else if ( (a == v && b == u && c == y && d == w && e == z && f == x )){ bExist = true; break;}
else if ( (a == v && b == u && c == y && d == x && e == w && f == z )){ bExist = true; break;}
else if ( (a == v && b == u && c == y && d == x && e == z && f == w )){ bExist = true; break;}
else if ( (a == v && b == u && c == y && d == z && e == w && f == x )){ bExist = true; break;}
else if ( (a == v && b == u && c == y && d == z && e == x && f == w )){ bExist = true; break;}
else if ( (a == v && b == u && c == z && d == w && e == x && f == y )){ bExist = true; break;}
else if ( (a == v && b == u && c == z && d == w && e == y && f == x )){ bExist = true; break;}
else if ( (a == v && b == u && c == z && d == x && e == w && f == y )){ bExist = true; break;}
else if ( (a == v && b == u && c == z && d == x && e == y && f == w )){ bExist = true; break;}
else if ( (a == v && b == u && c == z && d == y && e == w && f == x )){ bExist = true; break;}
else if ( (a == v && b == u && c == z && d == y && e == x && f == w )){ bExist = true; break;}
else if ( (a == v && b == w && c == u && d == x && e == y && f == z )){ bExist = true; break;}
else if ( (a == v && b == w && c == u && d == x && e == z && f == y )){ bExist = true; break;}
else if ( (a == v && b == w && c == u && d == y && e == x && f == z )){ bExist = true; break;}
else if ( (a == v && b == w && c == u && d == y && e == z && f == x )){ bExist = true; break;}
else if ( (a == v && b == w && c == u && d == z && e == x && f == y )){ bExist = true; break;}
else if ( (a == v && b == w && c == u && d == z && e == y && f == x )){ bExist = true; break;}
else if ( (a == v && b == w && c == x && d == u && e == y && f == z )){ bExist = true; break;}
else if ( (a == v && b == w && c == x && d == u && e == z && f == y )){ bExist = true; break;}
else if ( (a == v && b == w && c == x && d == y && e == u && f == z )){ bExist = true; break;}
else if ( (a == v && b == w && c == x && d == y && e == z && f == u )){ bExist = true; break;}
else if ( (a == v && b == w && c == x && d == z && e == u && f == y )){ bExist = true; break;}
else if ( (a == v && b == w && c == x && d == z && e == y && f == u )){ bExist = true; break;}
else if ( (a == v && b == w && c == y && d == u && e == x && f == z )){ bExist = true; break;}
else if ( (a == v && b == w && c == y && d == u && e == z && f == x )){ bExist = true; break;}
else if ( (a == v && b == w && c == y && d == x && e == u && f == z )){ bExist = true; break;}
else if ( (a == v && b == w && c == y && d == x && e == z && f == u )){ bExist = true; break;}
else if ( (a == v && b == w && c == y && d == z && e == u && f == x )){ bExist = true; break;}
else if ( (a == v && b == w && c == y && d == z && e == x && f == u )){ bExist = true; break;}
else if ( (a == v && b == w && c == z && d == u && e == x && f == y )){ bExist = true; break;}
else if ( (a == v && b == w && c == z && d == u && e == y && f == x )){ bExist = true; break;}
else if ( (a == v && b == w && c == z && d == x && e == u && f == y )){ bExist = true; break;}
else if ( (a == v && b == w && c == z && d == x && e == y && f == u )){ bExist = true; break;}
else if ( (a == v && b == w && c == z && d == y && e == u && f == x )){ bExist = true; break;}
else if ( (a == v && b == w && c == z && d == y && e == x && f == u )){ bExist = true; break;}
else if ( (a == v && b == x && c == u && d == w && e == y && f == z )){ bExist = true; break;}
else if ( (a == v && b == x && c == u && d == w && e == z && f == y )){ bExist = true; break;}
else if ( (a == v && b == x && c == u && d == y && e == w && f == z )){ bExist = true; break;}
else if ( (a == v && b == x && c == u && d == y && e == z && f == w )){ bExist = true; break;}
else if ( (a == v && b == x && c == u && d == z && e == w && f == y )){ bExist = true; break;}
else if ( (a == v && b == x && c == u && d == z && e == y && f == w )){ bExist = true; break;}
else if ( (a == v && b == x && c == w && d == u && e == y && f == z )){ bExist = true; break;}
else if ( (a == v && b == x && c == w && d == u && e == z && f == y )){ bExist = true; break;}
else if ( (a == v && b == x && c == w && d == y && e == u && f == z )){ bExist = true; break;}
else if ( (a == v && b == x && c == w && d == y && e == z && f == u )){ bExist = true; break;}
else if ( (a == v && b == x && c == w && d == z && e == u && f == y )){ bExist = true; break;}
else if ( (a == v && b == x && c == w && d == z && e == y && f == u )){ bExist = true; break;}
else if ( (a == v && b == x && c == y && d == u && e == w && f == z )){ bExist = true; break;}
else if ( (a == v && b == x && c == y && d == u && e == z && f == w )){ bExist = true; break;}
else if ( (a == v && b == x && c == y && d == w && e == u && f == z )){ bExist = true; break;}
else if ( (a == v && b == x && c == y && d == w && e == z && f == u )){ bExist = true; break;}
else if ( (a == v && b == x && c == y && d == z && e == u && f == w )){ bExist = true; break;}
else if ( (a == v && b == x && c == y && d == z && e == w && f == u )){ bExist = true; break;}
else if ( (a == v && b == x && c == z && d == u && e == w && f == y )){ bExist = true; break;}
else if ( (a == v && b == x && c == z && d == u && e == y && f == w )){ bExist = true; break;}
else if ( (a == v && b == x && c == z && d == w && e == u && f == y )){ bExist = true; break;}
else if ( (a == v && b == x && c == z && d == w && e == y && f == u )){ bExist = true; break;}
else if ( (a == v && b == x && c == z && d == y && e == u && f == w )){ bExist = true; break;}
else if ( (a == v && b == x && c == z && d == y && e == w && f == u )){ bExist = true; break;}
else if ( (a == v && b == y && c == u && d == w && e == x && f == z )){ bExist = true; break;}
else if ( (a == v && b == y && c == u && d == w && e == z && f == x )){ bExist = true; break;}
else if ( (a == v && b == y && c == u && d == x && e == w && f == z )){ bExist = true; break;}
else if ( (a == v && b == y && c == u && d == x && e == z && f == w )){ bExist = true; break;}
else if ( (a == v && b == y && c == u && d == z && e == w && f == x )){ bExist = true; break;}
else if ( (a == v && b == y && c == u && d == z && e == x && f == w )){ bExist = true; break;}
else if ( (a == v && b == y && c == w && d == u && e == x && f == z )){ bExist = true; break;}
else if ( (a == v && b == y && c == w && d == u && e == z && f == x )){ bExist = true; break;}
else if ( (a == v && b == y && c == w && d == x && e == u && f == z )){ bExist = true; break;}
else if ( (a == v && b == y && c == w && d == x && e == z && f == u )){ bExist = true; break;}
else if ( (a == v && b == y && c == w && d == z && e == u && f == x )){ bExist = true; break;}
else if ( (a == v && b == y && c == w && d == z && e == x && f == u )){ bExist = true; break;}
else if ( (a == v && b == y && c == x && d == u && e == w && f == z )){ bExist = true; break;}
else if ( (a == v && b == y && c == x && d == u && e == z && f == w )){ bExist = true; break;}
else if ( (a == v && b == y && c == x && d == w && e == u && f == z )){ bExist = true; break;}
else if ( (a == v && b == y && c == x && d == w && e == z && f == u )){ bExist = true; break;}
else if ( (a == v && b == y && c == x && d == z && e == u && f == w )){ bExist = true; break;}
else if ( (a == v && b == y && c == x && d == z && e == w && f == u )){ bExist = true; break;}
else if ( (a == v && b == y && c == z && d == u && e == w && f == x )){ bExist = true; break;}
else if ( (a == v && b == y && c == z && d == u && e == x && f == w )){ bExist = true; break;}
else if ( (a == v && b == y && c == z && d == w && e == u && f == x )){ bExist = true; break;}
else if ( (a == v && b == y && c == z && d == w && e == x && f == u )){ bExist = true; break;}
else if ( (a == v && b == y && c == z && d == x && e == u && f == w )){ bExist = true; break;}
else if ( (a == v && b == y && c == z && d == x && e == w && f == u )){ bExist = true; break;}
else if ( (a == v && b == z && c == u && d == w && e == x && f == y )){ bExist = true; break;}
else if ( (a == v && b == z && c == u && d == w && e == y && f == x )){ bExist = true; break;}
else if ( (a == v && b == z && c == u && d == x && e == w && f == y )){ bExist = true; break;}
else if ( (a == v && b == z && c == u && d == x && e == y && f == w )){ bExist = true; break;}
else if ( (a == v && b == z && c == u && d == y && e == w && f == x )){ bExist = true; break;}
else if ( (a == v && b == z && c == u && d == y && e == x && f == w )){ bExist = true; break;}
else if ( (a == v && b == z && c == w && d == u && e == x && f == y )){ bExist = true; break;}
else if ( (a == v && b == z && c == w && d == u && e == y && f == x )){ bExist = true; break;}
else if ( (a == v && b == z && c == w && d == x && e == u && f == y )){ bExist = true; break;}
else if ( (a == v && b == z && c == w && d == x && e == y && f == u )){ bExist = true; break;}
else if ( (a == v && b == z && c == w && d == y && e == u && f == x )){ bExist = true; break;}
else if ( (a == v && b == z && c == w && d == y && e == x && f == u )){ bExist = true; break;}
else if ( (a == v && b == z && c == x && d == u && e == w && f == y )){ bExist = true; break;}
else if ( (a == v && b == z && c == x && d == u && e == y && f == w )){ bExist = true; break;}
else if ( (a == v && b == z && c == x && d == w && e == u && f == y )){ bExist = true; break;}
else if ( (a == v && b == z && c == x && d == w && e == y && f == u )){ bExist = true; break;}
else if ( (a == v && b == z && c == x && d == y && e == u && f == w )){ bExist = true; break;}
else if ( (a == v && b == z && c == x && d == y && e == w && f == u )){ bExist = true; break;}
else if ( (a == v && b == z && c == y && d == u && e == w && f == x )){ bExist = true; break;}
else if ( (a == v && b == z && c == y && d == u && e == x && f == w )){ bExist = true; break;}
else if ( (a == v && b == z && c == y && d == w && e == u && f == x )){ bExist = true; break;}
else if ( (a == v && b == z && c == y && d == w && e == x && f == u )){ bExist = true; break;}
else if ( (a == v && b == z && c == y && d == x && e == u && f == w )){ bExist = true; break;}
else if ( (a == v && b == z && c == y && d == x && e == w && f == u )){ bExist = true; break;}
else if ( (a == w && b == u && c == v && d == x && e == y && f == z )){ bExist = true; break;}
else if ( (a == w && b == u && c == v && d == x && e == z && f == y )){ bExist = true; break;}
else if ( (a == w && b == u && c == v && d == y && e == x && f == z )){ bExist = true; break;}
else if ( (a == w && b == u && c == v && d == y && e == z && f == x )){ bExist = true; break;}
else if ( (a == w && b == u && c == v && d == z && e == x && f == y )){ bExist = true; break;}
else if ( (a == w && b == u && c == v && d == z && e == y && f == x )){ bExist = true; break;}
else if ( (a == w && b == u && c == x && d == v && e == y && f == z )){ bExist = true; break;}
else if ( (a == w && b == u && c == x && d == v && e == z && f == y )){ bExist = true; break;}
else if ( (a == w && b == u && c == x && d == y && e == v && f == z )){ bExist = true; break;}
else if ( (a == w && b == u && c == x && d == y && e == z && f == v )){ bExist = true; break;}
else if ( (a == w && b == u && c == x && d == z && e == v && f == y )){ bExist = true; break;}
else if ( (a == w && b == u && c == x && d == z && e == y && f == v )){ bExist = true; break;}
else if ( (a == w && b == u && c == y && d == v && e == x && f == z )){ bExist = true; break;}
else if ( (a == w && b == u && c == y && d == v && e == z && f == x )){ bExist = true; break;}
else if ( (a == w && b == u && c == y && d == x && e == v && f == z )){ bExist = true; break;}
else if ( (a == w && b == u && c == y && d == x && e == z && f == v )){ bExist = true; break;}
else if ( (a == w && b == u && c == y && d == z && e == v && f == x )){ bExist = true; break;}
else if ( (a == w && b == u && c == y && d == z && e == x && f == v )){ bExist = true; break;}
else if ( (a == w && b == u && c == z && d == v && e == x && f == y )){ bExist = true; break;}
else if ( (a == w && b == u && c == z && d == v && e == y && f == x )){ bExist = true; break;}
else if ( (a == w && b == u && c == z && d == x && e == v && f == y )){ bExist = true; break;}
else if ( (a == w && b == u && c == z && d == x && e == y && f == v )){ bExist = true; break;}
else if ( (a == w && b == u && c == z && d == y && e == v && f == x )){ bExist = true; break;}
else if ( (a == w && b == u && c == z && d == y && e == x && f == v )){ bExist = true; break;}
else if ( (a == w && b == v && c == u && d == x && e == y && f == z )){ bExist = true; break;}
else if ( (a == w && b == v && c == u && d == x && e == z && f == y )){ bExist = true; break;}
else if ( (a == w && b == v && c == u && d == y && e == x && f == z )){ bExist = true; break;}
else if ( (a == w && b == v && c == u && d == y && e == z && f == x )){ bExist = true; break;}
else if ( (a == w && b == v && c == u && d == z && e == x && f == y )){ bExist = true; break;}
else if ( (a == w && b == v && c == u && d == z && e == y && f == x )){ bExist = true; break;}
else if ( (a == w && b == v && c == x && d == u && e == y && f == z )){ bExist = true; break;}
else if ( (a == w && b == v && c == x && d == u && e == z && f == y )){ bExist = true; break;}
else if ( (a == w && b == v && c == x && d == y && e == u && f == z )){ bExist = true; break;}
else if ( (a == w && b == v && c == x && d == y && e == z && f == u )){ bExist = true; break;}
else if ( (a == w && b == v && c == x && d == z && e == u && f == y )){ bExist = true; break;}
else if ( (a == w && b == v && c == x && d == z && e == y && f == u )){ bExist = true; break;}
else if ( (a == w && b == v && c == y && d == u && e == x && f == z )){ bExist = true; break;}
else if ( (a == w && b == v && c == y && d == u && e == z && f == x )){ bExist = true; break;}
else if ( (a == w && b == v && c == y && d == x && e == u && f == z )){ bExist = true; break;}
else if ( (a == w && b == v && c == y && d == x && e == z && f == u )){ bExist = true; break;}
else if ( (a == w && b == v && c == y && d == z && e == u && f == x )){ bExist = true; break;}
else if ( (a == w && b == v && c == y && d == z && e == x && f == u )){ bExist = true; break;}
else if ( (a == w && b == v && c == z && d == u && e == x && f == y )){ bExist = true; break;}
else if ( (a == w && b == v && c == z && d == u && e == y && f == x )){ bExist = true; break;}
else if ( (a == w && b == v && c == z && d == x && e == u && f == y )){ bExist = true; break;}
else if ( (a == w && b == v && c == z && d == x && e == y && f == u )){ bExist = true; break;}
else if ( (a == w && b == v && c == z && d == y && e == u && f == x )){ bExist = true; break;}
else if ( (a == w && b == v && c == z && d == y && e == x && f == u )){ bExist = true; break;}
else if ( (a == w && b == x && c == u && d == v && e == y && f == z )){ bExist = true; break;}
else if ( (a == w && b == x && c == u && d == v && e == z && f == y )){ bExist = true; break;}
else if ( (a == w && b == x && c == u && d == y && e == v && f == z )){ bExist = true; break;}
else if ( (a == w && b == x && c == u && d == y && e == z && f == v )){ bExist = true; break;}
else if ( (a == w && b == x && c == u && d == z && e == v && f == y )){ bExist = true; break;}
else if ( (a == w && b == x && c == u && d == z && e == y && f == v )){ bExist = true; break;}
else if ( (a == w && b == x && c == v && d == u && e == y && f == z )){ bExist = true; break;}
else if ( (a == w && b == x && c == v && d == u && e == z && f == y )){ bExist = true; break;}
else if ( (a == w && b == x && c == v && d == y && e == u && f == z )){ bExist = true; break;}
else if ( (a == w && b == x && c == v && d == y && e == z && f == u )){ bExist = true; break;}
else if ( (a == w && b == x && c == v && d == z && e == u && f == y )){ bExist = true; break;}
else if ( (a == w && b == x && c == v && d == z && e == y && f == u )){ bExist = true; break;}
else if ( (a == w && b == x && c == y && d == u && e == v && f == z )){ bExist = true; break;}
else if ( (a == w && b == x && c == y && d == u && e == z && f == v )){ bExist = true; break;}
else if ( (a == w && b == x && c == y && d == v && e == u && f == z )){ bExist = true; break;}
else if ( (a == w && b == x && c == y && d == v && e == z && f == u )){ bExist = true; break;}
else if ( (a == w && b == x && c == y && d == z && e == u && f == v )){ bExist = true; break;}
else if ( (a == w && b == x && c == y && d == z && e == v && f == u )){ bExist = true; break;}
else if ( (a == w && b == x && c == z && d == u && e == v && f == y )){ bExist = true; break;}
else if ( (a == w && b == x && c == z && d == u && e == y && f == v )){ bExist = true; break;}
else if ( (a == w && b == x && c == z && d == v && e == u && f == y )){ bExist = true; break;}
else if ( (a == w && b == x && c == z && d == v && e == y && f == u )){ bExist = true; break;}
else if ( (

Looks like there are two sets of six variables (a, b, c, d, e, f) and (u, v, w, x, y, x). This code attempts to check if the same six values are included in each set, but not necessarily in the same order so it explicitly checks for every combination. This could be done more efficiently by placing the values in arrays, sorting the arrays, and then comparing. You could also get the same result without sorting by searching the second array for each value of the first.
Here's some code using sorting. It assumes the variables are of type int, but should work for other types.
public static boolean compareValues(int a, int b, int c, int d, int e, int f,
                                 int u, int v, int w, int x, int y, int z) {
        int[] array1 = new int[6];
        int[] array2 = new int[6];
        // load array 1
        array1[0] = a;
        array1[1] = b;
        array1[2] = c;
        array1[3] = d;
        array1[4] = e;
        array1[5] = f;
        // load array 2
        array2[0] = u;
        array2[1] = v;
        array2[2] = w;
        array2[3] = x;
        array2[4] = y;
        array2[5] = z;
        java.util.Arrays.sort(array1);
        java.util.Arrays.sort(array2);
        for (int i = 0; i < array1.length; i++) {
            if (array1[i] != array2) {
return false;
return true;

Similar Messages

  • How to optimize this select statement  its a simple select....

    how to optimize this select statement  as the records in earlier table is abt i million
    and this simplet select statement is not executing and taking lot of time
      SELECT  guid  
                    stcts      
      INTO table gt_corcts
      FROM   corcts
      FOR all entries in gt_mege
      WHERE  /sapsll/corcts~stcts = gt_mege-ctsex
      and /sapsll/corcts~guid_pobj = gt_Sagmeld-guid_pobj.
    regards
    Arora

    Hi Arora,
    Using Package size is very simple and you can avoid the time out and as well as the problem because of memory.  Some time if you have too many records in the internal table, then you will get a short dump called TSV_TNEW_PAGE_ALLOC_FAILED.
    Below is the sample code.
    DATA p_size = 50000
    SELECT field1 field2 field3
       INTO TABLE itab1 PACKAGE SIZE p_size
       FROM dtab
       WHERE <condition>
    Other logic or process on the internal table itab1
    FREE itab1.
    ENDSELECT.
    Here the only problem is you have to put the ENDSELECT.
    How it works
    In the first select it will select 50000 records ( or the p_size you gave).  That will be in the internal table itab1.
    In the second select it will clear the 50000 records already there and append next 50000 records from the database table.
    So care should be taken to do all the logic or process with in select and endselect.
    Some ABAP standards may not allow you to use select-endselect.  But this is the best way to handle huge data without short dumps and memory related problems. 
    I am using this approach.  My data is much more huge than yours.  At an average of atleast 5 millions records per select.
    Good luck and hope this help you.
    Regards,
    Kasthuri Rangan Srinivasan

  • Hi, when ever I'm using 3G, on my Iphone4 sim stops working and Network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem.

    Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem. Thanks.

    Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
    Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore.

  • My Creative Cloud subscription has expired, and I assigned the monthly payment, but I can not open any progam creative cloud, I need help how to solve this problem

    my Creative Cloud subscription has expired, and I assigned the monthly payment, but I can not open any progam creative cloud, I need help how to solve this problem

    Carlos-
    Start by signing out and back in to see if it will see the subscription: 
    How to sign in and sign out of creative cloud (activate/deactivate)
    If the apps are installed fine and close after launch see this link:
    CC applications close immediately after launch
    If the problem is something different, please let us know the error you see or what is happening on the screen so we can advise  you on a solution
    Pattie

  • How to optimize this sql by writing MINUS function.

    Hi all,
    how to optimize the sql by writing MINUS function.
    these are my tables
    1. CREATE TABLE POSTPAID
    RECORD VARCHAR2(2000 BYTE),
    FLAG NUMBER
    Record format:
    Mobile no in 1:10 of that length
    2. CREATE TABLE SUBSCRIBER
    PHONE_NO VARCHAR2(10 BYTE)
    My requirement is following sql need write using ‘minus’ as this one is very slow
    select record record from POSTPAID where substr(record,9,10) NOT in (select PHONE_NO from SUBSCRIBER)
    Thanks

    Why are you very particular about using "MINUS". You can optimize the sql by using "NOT EXISTS" instead of "NOT IN" as below:
    SELECT RECORD FROM POSTPAID A WHERE NOT EXISTS (SELECT 1 FROM SUBSCRIBER B WHERE SUBSTR(A.RECORD,9,10) = B.PHONE_NO)

  • Performance Tuning Issues  ( How to Optimize this Code)

    _How to Optimize this Code_
    FORM MATL_CODE_DESC.
      SELECT * FROM VBAK WHERE VKORG EQ SAL_ORG AND
                               VBELN IN VBELN AND
                               VTWEG IN DIS_CHN AND
                               SPART IN DIVISION AND
                               VKBUR IN SAL_OFF AND
                               VBTYP EQ 'C' AND
                               KUNNR IN KUNNR AND
                               ERDAT BETWEEN DAT_FROM AND DAT_TO.
        SELECT * FROM VBAP WHERE VBELN EQ VBAK-VBELN AND
                                 MATNR IN MATNR.
          SELECT SINGLE * FROM MAKT WHERE MATNR EQ VBAP-MATNR.
          IF SY-SUBRC EQ 0.
            IF ( VBAP-NETWR EQ 0 AND VBAP-UEPOS NE 0 ).
              IF ( VBAP-UEPVW NE 'B' AND VBAP-UEPVW NE 'C' ).
                MOVE VBAP-VBELN TO ITAB1-SAL_ORD_NUM.
                MOVE VBAP-POSNR TO ITAB1-POSNR.
                MOVE VBAP-MATNR TO ITAB1-FREE_MATL.
                MOVE VBAP-KWMENG TO ITAB1-FREE_QTY.
                MOVE VBAP-KLMENG TO ITAB1-KLMENG.
                MOVE VBAP-VRKME TO ITAB1-FREE_UNIT.
                MOVE VBAP-WAVWR TO ITAB1-FREE_VALUE.
                MOVE VBAK-VTWEG TO ITAB1-VTWEG.
                MOVE VBAP-UEPOS TO ITAB1-UEPOS.
              ENDIF.
            ELSE.
              MOVE VBAK-VBELN TO ITAB1-SAL_ORD_NUM.
              MOVE VBAK-VTWEG TO ITAB1-VTWEG.
              MOVE VBAK-ERDAT TO ITAB1-SAL_ORD_DATE.
              MOVE VBAK-KUNNR TO ITAB1-CUST_NUM.
              MOVE VBAK-KNUMV TO ITAB1-KNUMV.
             SELECT SINGLE * FROM KONV WHERE KNUMV EQ VBAK-KNUMV AND
                                             KSTEU = 'C' AND
                                             KHERK EQ 'A' AND
                                             KMPRS = 'X'.
             IF SY-SUBRC EQ 0.
               ITAB1-REMARKS = 'Manual Price Change'.
             ENDIF.
              SELECT SINGLE * FROM KONV WHERE KNUMV EQ VBAK-KNUMV AND
                                              KSTEU = 'C' AND
                                              KHERK IN ('C','D') AND
                                              KMPRS = 'X' AND
                                              KRECH IN ('A','B').
              IF SY-SUBRC EQ 0.
                IF KONV-KRECH EQ 'A'.
                  MOVE : KONV-KSCHL TO G_KSCHL.
                  G_KBETR = ( KONV-KBETR / 10 ).
                  MOVE G_KBETR TO G_KBETR1.
                  CONCATENATE G_KSCHL G_KBETR1 '%'
                              INTO ITAB1-REMARKS SEPARATED BY SPACE.
                ELSEIF KONV-KRECH EQ 'B'.
                  MOVE : KONV-KSCHL TO G_KSCHL.
                  G_KBETR = KONV-KBETR.
                  MOVE G_KBETR TO G_KBETR1.
                  CONCATENATE G_KSCHL G_KBETR1
                              INTO ITAB1-REMARKS SEPARATED BY SPACE.
                ENDIF.
              ELSE.
                ITAB1-REMARKS = 'Manual Price Change'.
              ENDIF.
              CLEAR : G_KBETR, G_KSCHL,G_KBETR1.
              MOVE VBAP-KWMENG TO ITAB1-QTY.
              MOVE VBAP-VRKME TO ITAB1-QTY_UNIT.
              IF VBAP-UMVKN NE 0.
                ITAB1-KLMENG = ( VBAP-UMVKZ / VBAP-UMVKN ) * VBAP-KWMENG.
              ENDIF.
              IF ITAB1-KLMENG NE 0.
                VBAP-NETWR = ( VBAP-NETWR / VBAP-KWMENG ).
                MOVE VBAP-NETWR TO ITAB1-INV_PRICE.
              ENDIF.
              MOVE VBAP-POSNR TO ITAB1-POSNR.
              MOVE VBAP-MATNR TO ITAB1-MATNR.
              MOVE MAKT-MAKTX TO ITAB1-MAKTX.
            ENDIF.
            SELECT SINGLE * FROM VBKD WHERE VBELN EQ VBAK-VBELN AND
                                            BSARK NE 'DFUE'.
            IF SY-SUBRC EQ 0.
              ITAB1-INV_PRICE = ITAB1-INV_PRICE * VBKD-KURSK.
              APPEND ITAB1.
              CLEAR ITAB1.
            ELSE.
              CLEAR ITAB1.
            ENDIF.
          ENDIF.
        ENDSELECT.
      ENDSELECT.
    ENDFORM.                               " MATL_CODE_DESC

    Hi Vijay,
    You could start by using INNER JOINS:
    SELECT ......
                FROM (                    VBAK
                             INNER JOIN VBAP
                                           ON VBAPVBELN = VBAKVBELN
                             INNER JOIN MAKT
                                           ON MAKTMATNR = VBAPMATNR AND
                                                 MAKT~SPRAS = SYST-LANGU )
                INTO TABLE itab
              WHERE VBAK~VBELN IN VBELN
                   AND VBAK~VTWEG IN DIS_CHN
                   AND VBAK~SPART IN DIVISION
                   AND VBAK~VKBUR IN SAL_OFF
                   AND VBAK~VBTYP EQ 'C'
                   AND VBAK~KUNNR IN KUNNR
                   AND VBAK~ERDAT BETWEEN DAT_FROM AND DAT_TO
                   AND VBAP~NETWR EQ 0
                   AND VBAP~UEPOS NE 0
    Regards,
    John.

  • How to optimize this SQL. Help needed.

    Hi All,
    Can you please help with this SQL:
    SELECT /*+ INDEX(zl1 zipcode_lat1) */
    zl2.zipcode as zipcode,l.location_id as location_id,
    sqrt(POWER((69.1 * ((zl2.latitude*57.295779513082320876798154814105) - (zl1.latitude*57.295779513082320876798154814105))),2) + POWER((69.1 * ((zl2.longitude*57.295779513082320876798154814105) - (zl1.longitude*57.295779513082320876798154814105)) * cos((zl1.latitude*57.295779513082320876798154814105)/57.3)),2)) as distance
    FROM location_atao l, zipcode_atao zl1, client c, zipcode_atao zl2
    WHERE zl1.zipcode = l.zipcode
    AND l.client_id = c.client_id
    AND c.client_id = 306363
    And l.appType = 'HOURLY'
    and c.milessearchzipcode >= sqrt(POWER((69.1 * ((zl2.latitude*57.295779513082320876798154814105) - (zl1.latitude*57.295779513082320876798154814105))),2) + POWER((69.1 * ((zl2.longitude*57.295779513082320876798154814105) - (zl1.longitude*57.295779513082320876798154814105)) * cos((zl1.latitude*57.295779513082320876798154814105)/57.3)),2))
    I tried to optimize it by adding country column in zipcode_atao table. So that we can limit the search in zipcode_atao table based on country.
    Any other suggestions.
    Thanks

    Welcome to the forum.
    Please follow the instructions given in this thread:
    How to post a SQL statement tuning request
    HOW TO: Post a SQL statement tuning request - template posting
    and add the nessecary details we need to your thread.
    Depending on your database version (the result of: select * from v$version; ):
    Have you tried running the query without the index-hint?
    Are your table (and index) statatistics up-to-date?

  • How to optimize this query? Please help

    i have one table(argus) having 80,000 rows and another table (p0f) having 30,000 rows and i have to join both table on the basis of time field. the query is as follows
    select distinct(start_time),res.port, res.dst_port from (select * from argus where argus.start_time between '2007-06-13 19:00:00' and '2007-06-22 20:00:00') res left outer join p0f on res.start_time=p0f.p0f_timestamp ;
    the query is taking very large time . i have created index on the start_time and p0f_timestamp ,it increased the performance but not so much. My date comparisons would vary every time i have to execute a new query.
    Plz tell me is there another way to execute such a query to output same results?
    plz help me as my records are increasing day by day
    Thanks
    Shaveta

    From my small testcase it seems that both queries are absolute identical and don't actually take too much time:
    SQL> create table argus as (select created start_time, object_id port, object_id dst_port from all_objects union all
      2                         select created start_time, object_id port, object_id dst_port from all_objects)
      3  /
    Table created.
    SQL> create table p0f as select created p0f_timestamp, object_id p0f_port, object_id p0f_dst_port from all_objects
      2  /
    Table created.
    SQL> create index argus_idx on argus (start_time)
      2  /
    Index created.
    SQL> create index p0f_idx on p0f (p0f_timestamp)
      2  /
    Index created.
    SQL>
    SQL> begin
      2   dbms_stats.gather_table_stats(user,'argus',cascade=>true);
      3   dbms_stats.gather_table_stats(user,'p0f',cascade=>true);
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> select count(*) from argus
      2  /
      COUNT(*)
         94880
    SQL> select count(*) from p0f
      2  /
      COUNT(*)
         47441
    SQL>
    SQL> set timing on
    SQL> set autotrace traceonly explain statistics
    SQL>
    SQL> select distinct (start_time), res.port, res.dst_port
      2             from (select *
      3                     from argus
      4                    where argus.start_time between to_date('2007-06-13 19:00:00','RRRR-MM-DD HH24:MI:SS')
      5                                               and to_date('2007-06-22 20:00:00','RRRR-MM-DD HH24:MI:SS')) res
      6                  left outer join
      7                  p0f on res.start_time = p0f.p0f_timestamp
      8                  ;
    246 rows selected.
    Elapsed: 00:00:02.51
    Execution Plan
    Plan hash value: 1442901002
    | Id  | Operation               | Name    | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT        |         | 21313 |   520K|       |   250   (6)| 00:00:04 |
    |   1 |  HASH UNIQUE            |         | 21313 |   520K|  1352K|   250   (6)| 00:00:04 |
    |*  2 |   FILTER                |         |       |       |       |            |          |
    |*  3 |    HASH JOIN RIGHT OUTER|         | 21313 |   520K|       |    91  (11)| 00:00:02 |
    |*  4 |     INDEX RANGE SCAN    | P0F_IDX |  3661 | 29288 |       |    11   (0)| 00:00:01 |
    |*  5 |     TABLE ACCESS FULL   | ARGUS   |  7325 |   121K|       |    79  (12)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(TO_DATE('2007-06-13 19:00:00','RRRR-MM-DD
                  HH24:MI:SS')<=TO_DATE('2007-06-22 20:00:00','RRRR-MM-DD HH24:MI:SS'))
       3 - access("ARGUS"."START_TIME"="P0F"."P0F_TIMESTAMP"(+))
       4 - access("P0F"."P0F_TIMESTAMP"(+)>=TO_DATE('2007-06-13 19:00:00','RRRR-MM-DD
                  HH24:MI:SS') AND "P0F"."P0F_TIMESTAMP"(+)<=TO_DATE('2007-06-22
                  20:00:00','RRRR-MM-DD HH24:MI:SS'))
       5 - filter("ARGUS"."START_TIME">=TO_DATE('2007-06-13 19:00:00','RRRR-MM-DD
                  HH24:MI:SS') AND "ARGUS"."START_TIME"<=TO_DATE('2007-06-22 20:00:00','RRRR-MM-DD
                  HH24:MI:SS'))
    Statistics
              1  recursive calls
              0  db block gets
            304  consistent gets
              0  physical reads
              0  redo size
           7354  bytes sent via SQL*Net to client
            557  bytes received via SQL*Net from client
             18  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
            246  rows processed
    SQL>
    SQL> select distinct start_time, port, dst_port
      2             from argus left outer join p0f on start_time = p0f_timestamp
      3            where start_time between to_date ('2007-06-13 19:00:00','RRRR-MM-DD HH24:MI:SS')
      4                                       and to_date ('2007-06-22 20:00:00','RRRR-MM-DD HH24:MI:SS')
      5  /
    246 rows selected.
    Elapsed: 00:00:02.47
    Execution Plan
    Plan hash value: 1442901002
    | Id  | Operation               | Name    | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT        |         | 21313 |   520K|       |   250   (6)| 00:00:04 |
    |   1 |  HASH UNIQUE            |         | 21313 |   520K|  1352K|   250   (6)| 00:00:04 |
    |*  2 |   FILTER                |         |       |       |       |            |          |
    |*  3 |    HASH JOIN RIGHT OUTER|         | 21313 |   520K|       |    91  (11)| 00:00:02 |
    |*  4 |     INDEX RANGE SCAN    | P0F_IDX |  3661 | 29288 |       |    11   (0)| 00:00:01 |
    |*  5 |     TABLE ACCESS FULL   | ARGUS   |  7325 |   121K|       |    79  (12)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - filter(TO_DATE('2007-06-13 19:00:00','RRRR-MM-DD
                  HH24:MI:SS')<=TO_DATE('2007-06-22 20:00:00','RRRR-MM-DD HH24:MI:SS'))
       3 - access("START_TIME"="P0F_TIMESTAMP"(+))
       4 - access("P0F_TIMESTAMP"(+)>=TO_DATE('2007-06-13 19:00:00','RRRR-MM-DD
                  HH24:MI:SS') AND "P0F_TIMESTAMP"(+)<=TO_DATE('2007-06-22 20:00:00','RRRR-MM-DD
                  HH24:MI:SS'))
       5 - filter("ARGUS"."START_TIME">=TO_DATE('2007-06-13 19:00:00','RRRR-MM-DD
                  HH24:MI:SS') AND "ARGUS"."START_TIME"<=TO_DATE('2007-06-22 20:00:00','RRRR-MM-DD
                  HH24:MI:SS'))
    Statistics
              1  recursive calls
              0  db block gets
            304  consistent gets
              0  physical reads
              0  redo size
           7354  bytes sent via SQL*Net to client
            557  bytes received via SQL*Net from client
             18  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
            246  rows processedCan you show us a similar testcase with explain plan and statistics?

  • Need help - how to run this particular method in the main method?

    Hi all,
    I have a problem with methods that involves objects such as:
    public static Animal get(String choice) { ... } How do we return the "Animal" type object? I understand codes that return an int or a String but when it comes to objects, I'm totally lost.
    For example this code:
    import java.util.Scanner;
    interface Animal {
        void soundOff();
    class Elephant implements Animal {
        public void soundOff() {
            System.out.println("Trumpet");
    class Lion implements Animal {
        public void soundOff() {
            System.out.println("Roar");
    class TestAnimal {
        public static void main(String[] args) {
            TestAnimal ta = new TestAnimal();
            ta.get(); // error
            // doing Animal a = new Animal() is horrible... :(                   
        public static Animal get(String choice) {
            Scanner myScanner = new Scanner(System.in);
            choice = myScanner.nextLine();
            if (choice.equalsIgnoreCase("meat eater")) {
                return new Lion();
            } else {
                return new Elephant();
    }Out of desperation, I tried "Animal a = new Animal() ", and it was disastrous because an interface cannot be instantiated. :-S And I have no idea what else to put in my main method to get the code running. Need some help please.
    Thank you.

    Hi paulcw,
    Thank you. I've modified my code but it still doesn't print "roar" or "trumpet". When it returns a Lion or an Elephant, wouldn't the soundOff() method get printed too?
    refactored:
    import java.util.Scanner;
    interface Animal {
        void soundOff();
    class Elephant implements Animal {
        public void soundOff() {
            System.out.println("Trumpet");
    class Lion implements Animal {
        public void soundOff() {
            System.out.println("Roar");
    class TestAnimal {
        public static void main(String[] args) {
            Animal a = get();
        public static Animal get() {
            Scanner myScanner = new Scanner(System.in);
            System.out.println("Meat eater or not?");
            String choice = myScanner.nextLine();
            if (choice.equalsIgnoreCase("meat eater")) {
                return new Lion();
            } else {
                return new Elephant();
    }The soundOff() method should override the soundOff(); method in the interface, right? So I'm thinking, it should print either "roar" or "trumpet" but it doesn't. hmm..

  • Mozilla Firefox is not allowing me to Copy and Paste, please help how to fix this problem

    i seem to have a problem with Mozilla Firefox, that when i tried copying a word or a sentence and then going to a different site, i Cannot Paste. and with Internet Explorer i able to do that. i would hate to stop using firefox cause of this but, it's really hurting me from browsing and moving forth in a fast paced , please help me how to fix it

    See:
    *http://kb.mozillazine.org/Granting_JavaScript_access_to_the_clipboard
    *https://addons.mozilla.org/firefox/addon/allowclipboard-helper/ - AllowClipboard Helper

  • How to optimize this??

    hello,
    i wrote this for extracting 9th highest salary from emp table.
    SQL> select min(sal) from
    2 (select distinct sal from emp
    3 where sal is not null
    4 order by sal desc)
    5 where rownum<=9;
    MIN(SAL)
    1250
    But It has limitation. when we enter rownum more than existing rows then it gives minimum sal which is at the last position. rather than giving error or any different sense.
    following is the query which has not satisfied its use in proper.
    SQL> select min(sal) from
    2 (select distinct sal from emp
    3 where sal is not null
    4 order by sal desc)
    5 where rownum<=40
    6 /
    MIN(SAL)
    800
    where 800 is on last positon in 14 rows table.
    please optimize and solve my problem.

    user8710598 wrote:
    only optimize or edit posted query...i knw the rank is given correct ans.That's a little demanding and rude of you. People are trying to help by understanding what you are actually trying to achieve.
    Anyway...
    SQL> ed
    Wrote file afiedt.buf
      1  select sal
      2  from (
      3    select sal, rownum as rn
      4    from (
      5      select distinct sal
      6      from emp
      7      order by sal desc
      8      )
      9    )
    10* where rn = 9
    SQL> /
           SAL
          1250
    SQL> ed
    Wrote file afiedt.buf
      1  select sal
      2  from (
      3    select sal, rownum as rn
      4    from (
      5      select distinct sal
      6      from emp
      7      order by sal desc
      8      )
      9    )
    10* where rn = 40
    SQL> /
    no rows selected
    SQL>

  • How to optimize this code + is design proper

    Well I have to implement tree programming here , what i mean by tree
    programming is i have data stored in tree format i,e I have parent
    object which will have child objects of same type the level of depth can
    go any long:
    I am able to store objects in tree format and also able to display properly Here
    is code but I am facing problems when i have to filter some child nodes based on some conditions:
    I have two question is this code fine is there anything wrong with desin Plus how to handle removing child node in tree scenation where child can be in any place.Below is code
    package menu;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import com.chartis.gp.support.util.BrokerSupportUtil;
    import com.chartis.gp.support.vo.Links;
    import com.chartis.kernel.user.UserVO;
    import com.chartis.kernel.utils.Utils;
    public class Utility{
         /* IN this class NavModel,CModel,CNode are some dummy classes
          * which help us read contents form some resources which are stored in dummy format
          * as Example of tree format stored data below is the example
          *    tree
          *       child1
          *       child2
          *       child3
          *              child3-1
          *                       child:q
          *                       child:r
          *                               child:a
          *              child3-2
          *       child4
         private static void populateChildLinks(NavModel navModel, Object objectNode, Links parent ){
              try{
                   List<Links> childLinks = new ArrayList<Links>();
                   Iterator it = navModel.getChildren( objectNode );
                   while( it.hasNext() ){
                        NavNode node = (NavNode) it.next();
                        CNode contentNode = node.getContentNode();
                        Links links = new Links();
                        links.setNodeName( contentNode.getNodeName() );
                        childLinks.add( links );
                        if( navModel.hasChildren( node ) ){
                             populateChildLinks( node, links );
                   parent.setChildren( childLinks );
              catch( Exception e ){
         private static Links createCategoryLinks(String categoryLinkName){
              Links categoryLinks = new Links();
              categoryLinks.setNodeName( categoryLinkName );
              return categoryLinks;
         public static Links setupLinks(String categoryLinkName,String name) {
              Links categoryLinks=null;
              CModel contentModel = new CModel();
              NavModel navModel = new NavModel();
              categoryLinks = Utility.createCategoryLinks( categoryLinkName);
              Object objectNode = contentModel.getLocator().findByUniqueName(name);
              if( objectNode != null ){
                   if( navModel.hasChildren( objectNode ) ){
                        populateChildLinks( navModel,objectNode, categoryLinks );
                  // This is where i am facing issue once i get list of links of childs
              // i have to delete how can i find that particular child in the list
              // do i have to iterate through all the links and delete or  which
              // way is better
         private static void filterLinks( Links parentNode,
                   List<Links> childNodeList ){
              List<Links> filteredResourceList = new ArrayList<Links>();
              if(  childNodeList!=null ){
                   Iterator<Links> childNodeIt = childNodeList.iterator();
                   while( childNodeIt.hasNext() ){
                        Links childNode = (Links) childNodeIt.next();
                        if(childNode.getChildren().size() >0 ){
                           filterLinks( childNode, childNode.getChildren() );
                        boolean removeNode = filterContents( childNode);
                        if(! removeNode ){
                             filteredResourceList.add( childNode );
              Iterator<Links> filteredResourceIt = filteredResourceList.iterator();
              while( filteredResourceIt.hasNext() ){
                   Links childNode = (Links) filteredResourceIt.next();
                   parentNode.getChildren().remove( childNode );
         // Let us consider this as some dummy method which returns true or false based on some conditions
         private static boolean filterContents( menu.Links childNode ){
              return false;
      package menu;
    import java.util.List;
    public class Links{
          private String nodeName;
         private List<Links> children;
         public List<Links> getChildren(){
              return children;
         public void setChildren( List<Links> children ){
              this.children = children;
         public String getNodeName(){
              return nodeName;
         public void setNodeName( String nodeName ){
              this.nodeName = nodeName;
    package menu;
    public class TreeDisplay{
         public static void main( String[] args ){
          Links link = Utility.setupLinks( "SomeName", "ResiyrbceBane");
           Utility.filterLinks( link, link.getChildren() );
    }Is the utility class with so many static class is ok?

    Vicky wrote:
    Thanks TPD
    If you could write more on it , it will be great i rarely find ocasations of using interfaces , however i don't think creating a new tree with valid node could be better solution as you have to create a new tree keeping the same hierarchy .The advantage is that all other components do not need to know that they work with a filtered tree.
    Certainly you can do it the other way around bye passing the tree and the filter to eg. the <tt>NotePrinter</tt> Object, but than all components working with the tree meight neet to know that ther are Node filters.
    I just came up with the Idea to give the nodes themselfes knowlege of the Filter via <tt>setFilter(Filter<Links> myFilter)</tt>. You would call this on the root node and in the <tt>getChildren()</tt> method you would check if the child apllies to the filter and pass that filter to the eliable childs before putting them into a new collection which is returned to the caller. Ofcause you should initialise the <tt>this.filter</tt> property in <tt>Links</tt> with a <tt>ALL_NODES</tt> constant.
    Also you should resist the tamptation to make the <tt>this.filter</tt> property in <tt>Links</tt> static. This would save you one line of code in the <tt>getCildren()</tt> method by the cost that you cannot have different trees with different filters in the same JVM.
    This kind of interference between threads is pretty hard to find later in production environments...
    bye
    TPD

  • SQL Help-How to achieve this?

    Hi,
    I have the following query on Oracle 10g:
    SELECT year, cargo, Balance_ThisYEAR, Balance_PreviousYear_categ, PCT, a.TERMINAL_ID
    FROM (
    SELECT /*+ ORDERED */
    extract(year from b.rsrc_util_date) as year,
    'CN' AS cargo,
    ROUND(SUM(c.summary_units), 0) Balance_ThisYEAR,
    Round(LAG(SUM(c.summary_units)) OVER(ORDER BY b.TERMINAL_ID, extract(year from b.rsrc_util_date)), 0) Balance_PreviousYear_categ,
    ROUND((SUM(c.summary_units) - LAG(SUM(c.summary_units)) OVER(ORDER BY b.TERMINAL_ID, extract(year from b.rsrc_util_date)))/LAG(SUM(c.summary_units)) OVER(ORDER BY b.TERMINAL_ID, extract(year from b.rsrc_util_date)) * 100,1) AS "PCT",
    b.TERMINAL_ID terminal_id
    FROM ...
    Results are:
    Year Cargo ThisYear PrevYear Percentage TerminalID
    1998     CN     835               NLP
    1999     CN     1288     835     54.3     NLP
    2000     CN     1209     1288     -6.1     NLP
    2001     CN     4708     1209     289.5     NLP
    2002     CN     2545     4708     -45.9     NLP
    2003     CN     358     2545     -85.9     NLP
    2004     CN     817     358     128.2     NLP
    2005     CN     1222     817     49.6     NLP
    2006     CN     618     1222     -49.4     NLP
    2007     CN     766     618     23.9     NLP
    2008     CN     702     766     -8.4     NLP
    2009     CN     543     702     -22.6     NLP
    2010     CN     332     543     -38.9     NLP
    2003     AU     125               NLP
    2004     AU     2     125     -98.4     NLP
    2008     AU     12494     2     624600     NLP
    2009     AU     6936     12494     -44.5     NLP
    1998     ST     25125               NLP
    1999     ST     214     25125     -99.1     NLP
    2000     ST     228     214     6.6     NLP
    2001     ST     1936     228     748.5     NLP
    2002     ST     104     1936     -94.6     NLP
    2003     ST     54     104     -48.1     NLP
    2004     ST     16337     54     30153.7     NLP
    2005     ST     18260     16337     11.8     NLP
    2006     ST     4896     18260     -73.2     NLP
    2007     ST     2494     4896     -49.1     NLP
    2001     RO     516               NLP
    2005     RO     10     516     -98.1     NLP
    The result is fine as long as there is a value for cargo for the previous year but when there is no previous year value the % should be 100 and not as it shows.
    Example:For Cargo AU Year 2008 as there is no year 2007 the query calculates it with respect to last year in the database i.e. 2004.It calculates like:12494-125/12494=624600
    Is there a way to get a value like 100% instead of 624600 wherever there is no immediate previous year?
    I would like something like:
    2003     AU     125     0     0     NLP
    2004     AU     2     125     -98.4     NLP
    2008     AU     12494     *0     100*     NLP
    2009     AU     6936     12494     -44.5     NLP
    Any help in this regard will be highly appreciated.
    Thanks
    Edited by: user11401592 on Sep 28, 2010 9:14 AM

    Give us some sample data to play with.
    something like that should do it :with mytable as (
    select 2003 year, 'AU' cargo, 125 summary_units, 'NLP' terminalid from dual
    union all select 2004, 'AU', 2, 'NLP' from dual
    union all select 2008, 'AU', 12494, 'NLP' from dual
    union all select 2009, 'AU', 6936, 'NLP' from dual
    union all select 2001, 'RO', 516, 'NLP' from dual
    union all select 2005, 'RO', 10, 'NLP' from dual
    select
            year,
            cargo,
            case
                    when last_year is null or last_year!=(year-1) then cast(null as number)
                    else last_summ
            end last_summ,
            curr_summ,
            case
                    when last_year is null or last_year!=(year-1) then 100
                    else trunc(100*v.curr_summ/v.last_summ,2)
            end pct,
            terminalid
    from (
            select
            year,
            lag(year)
                    over (partition by cargo, terminalid order by year) last_year,
            cargo,
            lag(summary_units)
                    over (partition by cargo, terminalid order by year) last_summ,
            summary_units curr_summ,
            terminalid
            from mytable
    ) v;
          YEAR CA  LAST_SUMM  CURR_SUMM        PCT TER
          2003 AU                   125        100 NLP
          2004 AU        125          2        1,6 NLP
          2008 AU                 12494        100 NLP
          2009 AU      12494       6936      55,51 NLP
          2001 RO                   516        100 NLP
          2005 RO                    10        100 NLP
    6 rows selected.

  • How to Optimize this code?

    Hi All
    I have a procedure which runs fine,but since the data in table XYZ,ABC runs into millions it becomes too slow..Can any one guide me in optimising the code.I have already created indexes on these columns.
    CREATE OR REPLACE PROCEDURE test AS
        CURSOR c1 IS
            SELECT
                t.cutGrp,
                t.cutGrpCode,
                t.modelDesc,
                t.startdate,
                t.enddate,
                avg(t.price) price,
                avg(t.netprice) netprice,
                sum(t.awdQTY) awardqty,
                sum(t.planQTY) revplanqty,
            FROM
                ABC t
            GROUP BY
                t.cutGrp,
                t.cutGrpCode,
                t.modelDesc,
                t.startdate,
                t.enddate;
    counter NUMBER := 0;
    l_aggregate NUMBER;
    BEGIN
         FOR rec IN c1
         LOOP
            counter := counter + 1;
            SELECT
                sum(t.anotherQTY) INTO l_aggregate
            FROM
                 XYZ t
            WHERE
                t.cutstomer_Grp = rec.cutGrp
                AND t.cutGrp_Code = rec.cutGrpCode
                AND t.product_model = rec.modelDesc;
            UPDATE XYZ t
            SET
                t.testQTY = l_aggregate,
                t.testprice = rec.price,
                t.testnetprice = rec.netprice,
                t.testawardQTY = rec.awardqty,
                t.testplanQTY = rec.revplanqty,         
                t.fcstartdate = rec.startdate,
                t.fcenddate = rec.enddate
            WHERE
                t.cutstomer_Grp = rec.cutGrp
                AND t.cutGrp_Code = rec.cutGrpCode
                AND t.cutGrp_Code = rec.modelDesc;
        END LOOP;
        COMMIT WORK;
    END test;
    SHOW ERRORS;

    Hi All
    This the only query i could come up with...But this gives me error
    ORA-30926 unable to get a stable set of rows in the source tables.Also this code does not address
    SELECT
                sum(t.anotherQTY) INTO l_aggregate
            FROM
                 XYZ t
            WHERE
                t.cutstomer_Grp = rec.cutGrp
                AND t.cutGrp_Code = rec.cutGrpCode
                AND t.product_model = rec.modelDesc;<b>This is what i came up with </b> so any code help is appreciated
    MERGE INTO sgforecastrecord b
    USING (
    SELECT
         cutGrp
         cutGrpCode ,
         modelDesc,
         startdate,
         enddate,
         avg(price) price,
         avg(netprice) netprice,
         sum(awdQTY) awardqty,
         sum(planQTY) revplanqty     
    FROM
          ABC
    GROUP BY
         cutGrp,
         cutGrp,
         modelDesc,
         startdate,
         enddate
    ) t
    on           (
         t.cutstomer_Grp = b.cutGrp
            AND t.cutGrp_Code = b.cutGrpCode
                AND t.product_model = b.modelDesc;
    WHEN MATCHED THEN
         UPDATE  set 
              b.testprice = t.price,
               b.testnetprice = t.netprice,
                b.testawardQTY = t.awardqty,
                b.testplanQTY = t.revplanqty,         
                b.fcstartdate = t.startdate,
                b.fcenddate = t.enddate
                                                                                

  • How to optimize this SQL?

    Hi All!
    For example I have to records from a table:
    Value1 Value2 Day_ID
    000001 000002 20031211
    000001 000002 20031219
    You can see, that value 1 and 2 are the same in both records. Only Day_IDs are different. So I need to find a record with max(Day_ID). This is my SQL:
    select *
    from MyTable
    where day_id = (select max(day_id) from MyTable)
    Is there any way to get the same result without sub select?
    Any help will be appreciate.
    With best regards,
    Andrej Litowka.

    ORA-00937: not a single-group group functionThen you must have a non-aggregated column in your SELECT clause that is not in your GROUP BY clause.
    Let's be careful out there!
    APC

Maybe you are looking for

  • Having a problem with ilife 08 and leopard screen saver

    Hi, Not sure if this is an osx leopard issue or a ilife 08 issue but before I did the upgrade I was able to use my entire iphoto library as random photos in the screensaver. Not it only let's me choose specific events or last import. it does not let

  • How do I make Pages the default word processing program?

    How do I make Pages the default word processing program, including Appleworks files? I want any Appleworks file I open to open in Pages - is there a setting to make that happen?

  • I am wondering what tools were used in the "Body Evolution" video

    Hi, I am wondering what the names of the tools that were used in the "Body Evolution" video? I know somw of them, but I don't know what tools they used for the eyes, nose and to stretch the legs. Thank you!

  • Documentation on "Inner Join"

    We are in the process of migrating to Oracle 9.2 and I was reading about some of the new features. In one of the code examples there was a query written using the "inner join" command, something that I was not familiar with but that was not presented

  • LWAPP 1231 does not join the controller

    I have LWAPP AIR-AP1231G-A-K9 that was moved from one site to the other one. It has now a different IP address taken from DHCP and its former controller does not exist any more. I am trying to join it to the same kind of controller which is AIR-WLC44