0

I have the following table:

Table: Test1

Text_Column
------------
2021AB022
1A012998F
ZAY
212P09990
1232124
PMP

Expected result is:

Only_text
----------
ZAY
PMP

Try:

SELECT Text_Column AS Only_text
FROM Test1
WHERE Text_Column REGEXP '(A,Z)'
MAK
  • 6,824
  • 25
  • 74
  • 131

2 Answers2

1

If your version of SQLite in fact supports REGEXP, then you were on the right track:

SELECT Text_Column AS Only_text
FROM Test1
WHERE Text_Column REGEXP '^[A-Z]+$';

But not all versions of SQLite would ship with REGEXP out of the box. Here is another SO question which discusses other ways to detect a number.

Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
0

I am not sure that this solves your problem, but works for the given example:

SELECT * FROM Test1 WHERE
Text_Column GLOB '*[^0-9]*';

giving back only the columns not containig characters in the range 0-9.

g_bor
  • 1,077
  • 6
  • 14