SQL Tip of the Day #109: Use CHARINDEX() to Find Position of a Substring
SELECT CHARINDEX('@', email) AS AtPosition
FROM Users;
Useful for basic email validation and parsing.
#SQLTips#StringFunctions#DataValidation#LearnSQL
split(str, [delimiter]) splits strings/vectors—auto-CHAR vec if no delimiter!
✂️Use a delimiter for CHAR/STRING vecs; vector input returns columnar tuples. Ideal for text parsing.
#DolphinDB#StringFunctions#TextParsing
rpad(str, length, [pattern]) pads strings on the right with your chosen pattern!
🧩Reach the target length easily—great for text alignment or standardizing string formats.
#DolphinDB#StringFunctions#TextFormattings
repeat(X, n) returns the string X repeated n times! 🔁
Super simple for duplicating text—ideal for quick string generation or pattern creation.
#DolphinDB#StringFunctions#TextGenerationf
lpad(str, length, [pattern]) pads strings (or table string cols) on the left!
🧩Ignores non-string columns—customize padding with an optional pattern. Perfect for text alignment.
#DolphinDB#StringFunctions#TextFormattingm
left(X, n) grabs the first n characters of X!
←Works on strings + table string columns (ignores other column types). Perfect for quick text slicing.
#DolphinDB#StringFunctions#DataSlicing
charAt(X, Y) fetches the character at position Y in string X! 🔍
Returns a CHAR type—handy for precise string slicing and text parsing tasks.
#DolphinDB#StringFunctions#TextProcessing
charAt(X, Y) fetches the character at position Y in string X! 🔍
Returns a CHAR type—handy for precise string slicing and text parsing tasks.
#DolphinDB#StringFunctions#TextProcessingG
SQL Tip of the Day: Use LEFT & RIGHT to Extract Fixed-Length Strings
SELECT LEFT(postal_code, 3) AS RegionCode FROM Addresses;
Simple way to extract string chunks without SUBSTRING().
#SQLTips#StringFunctions#LearnSQL#TSQL
SQL Tip Of The Day
Use REVERSE() to Flip Strings
SELECT REVERSE('SQL'); -- Outputs LQS
Niche, but fun and sometimes useful.
Ever had to reverse strings?
#SQLTips#StringFunctions#LearnSQL
SQL Tip Of The Day
Use PATINDEX for Pattern Search in Strings
SELECT PATINDEX('%@%.com%', email)
FROM Users;
Similar to LIKE but returns position.
Use it for validations?
#SQLTips#StringFunctions#DataQuality#LearnSQL