-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
  • 433
  • 1
  • 3
  • 18

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,242,037
  • 58
  • 646
  • 786
1

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

SELECT * 
FROM `table` 
WHERE RIGHT(`row`,1) = '.';
Rahul
  • 76,197
  • 13
  • 71
  • 125