Posts starting with upper case vs. lower case

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mythology Meta

Q&A about the site for enthusiasts and scholars of mythology and folklore

SELECT
  -- cf. https://stackoverflow.com/questions/14962419/is-the-like-operator-case-sensitive-with-mssql-server#comment67945696_14962728
  SUM(CASE WHEN Text LIKE '[ABCDEFGHIJKLMNOPQRSTUVWXYZ]%' THEN 1 ELSE 0 END) AS 'Upper',
  SUM(CASE WHEN Text LIKE '[abcdefghijklmnopqrstuvwxyz]%' THEN 1 ELSE 0 END) AS 'Lower'
  FROM PostHistory
  WHERE PostHistoryTypeId = 2
    AND CreationDate >= '2020-01-01'

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results