Query_Locate_2 |
|
SELECT |
✔ |
Details |
SELECT "ID", "memo", "position01", "hit01", "position02", CASE WHEN "position02" = 0 THEN '**not found**' WHEN "position02" < 10 THEN SUBSTRING ( "memo", 1, LOCATE(' ', "memo", 25)) ELSE SUBSTRING ( "memo", LOCATE( ' ', "memo", "position02" - 10 ) + 1, ( LOCATE( ' ', "memo", "position02" + 20 ) - ( LOCATE( ' ', "memo", "position02" - 10 ) + 1))) END AS "hit02", CASE WHEN "position02" = 0 THEN 0 ELSE LOCATE( LOWER (: Searchtext), LOWER ("memo"), "position02" + 1) END AS "position03" FROM ( SELECT "ID", "memo", "position01", CASE WHEN "position01" = 0 THEN '**not found**' WHEN "position01" < 10 THEN SUBSTRING ( "memo", 1, LOCATE(' ', "memo", 25)) ELSE SUBSTRING ( "memo", LOCATE( ' ', "memo", "position01" - 10 ) + 1, ( LOCATE( ' ', "memo", "position01" + 20 ) - ( LOCATE( ' ', "memo", "position01" - 10 ) + 1))) END AS "hit01", CASE WHEN "position01" = 0 THEN 0 ELSE LOCATE( LOWER (: Searchtext), LOWER ("memo"), "position01" + 1) END AS "position02" FROM ( SELECT "ID", "memo", LOCATE( LOWER (: Searchtext), LOWER ("memo")) "position01" FROM "table")) |
Query_Locate_5 |
|
SELECT |
|
Details |
SELECT "ID", "memo", "position01", "hit01", "position02", "hit02", "position03", "hit03", "position04", "hit04", "position05", CASE WHEN "position05" = 0 THEN '**not found**' WHEN "position05" < 10 THEN SUBSTRING ( "memo", 1, LOCATE(' ', "memo", 25)) ELSE SUBSTRING ( "memo", LOCATE( ' ', "memo", "position05" - 10 ) + 1, ( LOCATE( ' ', "memo", "position05" + 20 ) - ( LOCATE( ' ', "memo", "position05" - 10 ) + 1))) END "hit05", CASE WHEN "position05" = 0 THEN 0 ELSE LOCATE( LOWER (: Searchtext), LOWER ("memo"), "position05" + 1) END "position06" FROM ( SELECT "ID", "memo", "position01", "hit01", "position02", "hit02", "position03", "hit03", "position04", CASE WHEN "position04" = 0 THEN '**not found**' WHEN "position04" < 10 THEN SUBSTRING ( "memo", 1, LOCATE(' ', "memo", 25)) ELSE SUBSTRING ( "memo", LOCATE( ' ', "memo", "position04" - 10 ) + 1, ( LOCATE( ' ', "memo", "position04" + 20 ) - ( LOCATE( ' ', "memo", "position04" - 10 ) + 1))) END "hit04", CASE WHEN "position04" = 0 THEN 0 ELSE LOCATE( LOWER (: Searchtext), LOWER ("memo"), "position04" + 1) END "position05" FROM ( SELECT "ID", "memo", "position01", "hit01", "position02", "hit02", "position03", CASE WHEN "position03" = 0 THEN '**not found**' WHEN "position03" < 10 THEN SUBSTRING ( "memo", 1, LOCATE(' ', "memo", 25)) ELSE SUBSTRING ( "memo", LOCATE( ' ', "memo", "position03" - 10 ) + 1, ( LOCATE( ' ', "memo", "position03" + 20 ) - ( LOCATE( ' ', "memo", "position03" - 10 ) + 1))) END "hit03", CASE WHEN "position03" = 0 THEN 0 ELSE LOCATE( LOWER (: Searchtext), LOWER ("memo"), "position03" + 1) END "position04" FROM ( SELECT "ID", "memo", "position01", "hit01", "position02", CASE WHEN "position02" = 0 THEN '**not found**' WHEN "position02" < 10 THEN SUBSTRING ( "memo", 1, LOCATE(' ', "memo", 25)) ELSE SUBSTRING ( "memo", LOCATE( ' ', "memo", "position02" - 10 ) + 1, ( LOCATE( ' ', "memo", "position02" + 20 ) - ( LOCATE( ' ', "memo", "position02" - 10 ) + 1))) END "hit02", CASE WHEN "position02" = 0 THEN 0 ELSE LOCATE( LOWER (: Searchtext), LOWER ("memo"), "position02" + 1) END "position03" FROM ( SELECT "ID", "memo", "position01", CASE WHEN "position01" = 0 THEN '**not found**' WHEN "position01" < 10 THEN SUBSTRING ( "memo", 1, LOCATE(' ', "memo", 25)) ELSE SUBSTRING ( "memo", LOCATE( ' ', "memo", "position01" - 10 ) + 1, ( LOCATE( ' ', "memo", "position01" + 20 ) - ( LOCATE( ' ', "memo", "position01" - 10 ) + 1))) END "hit01", CASE WHEN "position01" = 0 THEN 0 ELSE LOCATE( LOWER (: Searchtext), LOWER ("memo"), "position01" + 1) END "position02" FROM ( SELECT "ID", "memo", LOCATE( LOWER (: Searchtext), LOWER ("memo")) "position01" FROM "table"))))) |