QuestionQ105

VerifiedData Operations and Support

A company has a data warehouse containing a table named Sales. The company stores this table in Amazon Redshift. The table has a column named city_name. The company needs to query the table to identify all rows whose city_name starts with "San" or "El".

Which SQL query meets this requirement?

Explanation

Amazon Redshift POSIX regular expressions use ^ to anchor a match at the beginning of a value and | to specify alternative expressions. Thus, ^(San|El) represents a value that begins with either San or El; $ anchors the end of a value, and & does not express alternation. Amazon Redshift POSIX operators

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!