-1

I want to select all rows in a table that end in a full stop.

When I use the following query, I get no results.

SELECT * FROM table WHERE row LIKE '%.'

But I know there is data in the table that ends in a full stop.

I noticed something about the full stop causing issues in MATCH AGAINST, but that should be unrelated.

Daniel
  • 421
  • 1
  • 3
  • 15

2 Answers2

2

You probably have no values that end in a period.

That seems simple enough.

First, see if there are any periods at all in the data:

SELECT * FROM table WHERE row LIKE '%.%'

If so, then period spaces are the issue:

SELECT * FROM table WHERE trim(row) LIKE '%.'
Gordon Linoff
  • 1,122,135
  • 50
  • 484
  • 624
1

You can probably use RIGHT() string function like below. See a Demo Here

SELECT * 
FROM `table` 
WHERE RIGHT(`row`,1) = '.';
Rahul
  • 71,392
  • 13
  • 57
  • 105