Question

I have multiple records that start with "She" like "shepherd", "shell", "shelf"... I want to return records that has "she" with

SELECT records FROM MYTABLE WHERE records = 'She'

However this returns all data mentioned above... how can I return just "she' without the rest of the data?

Was it helpful?

Solution

If you want to get the records where the word beings with "She" the query should be:

SELECT records FROM MYTABLE WHERE records LIKE 'She %'

OTHER TIPS

To just select the ones that start with "she" (will also select records that start with "shephard" etc):

  SELECT records FROM MYTABLE WHERE records LIKE 'she%'

The ones that have the word "she" in it:

  SELECT records FROM MYTABLE 
      WHERE records LIKE 'she %' OR 
            records LIKE '% she %' OR 
            records LIKE '% she'

You could perhaps use regular expressions as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top