Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.
SELECTSUBSTR("SQL Tutorial",5,3)ASExtractString; Try it Yourself » Definition and Usage The SUBSTR() function extracts a substring from a string (starting at any position). Note:The SUBSTR() andMID()functions equals to theSUBSTRING()function. ...
❮ MySQL Functions Example Replace "SQL" with "HTML": SELECTREPLACE("SQL Tutorial","SQL","HTML"); Try it Yourself » Definition and Usage The REPLACE() function replaces all occurrences of a substring within a string, with a new substring. ...
❮Previous❮ MS Access FunctionsNext❯ ExampleGet your own SQL Server Extract 3 characters from a string (starting from left): SELECTLeft("SQL Tutorial",3)ASExtractString; Try it Yourself » Definition and Usage The Left() function extracts a number of characters from a string (starting...
database="mydatabase" ) mycursor =mydb.cursor() sql ="DROP TABLE customers" mycursor.execute(sql) Run example » Drop Only if Exist If the table you want to delete is already deleted, or for any other reason does not exist, you can use the IF EXISTS keyword to avoid getting an ...
❮ MySQL Functions Example Remove leading and trailing spaces from a string: SELECTTRIM(' SQL Tutorial ')ASTrimmedString; Try it Yourself » Definition and Usage The TRIM() function removes leading and trailing spaces from a string.
MySQL RTRIM() Function❮ MySQL FunctionsExampleRemove trailing spaces from a string:SELECT RTRIM("SQL Tutorial ") AS RightTrimmedString; Try it Yourself » Definition and UsageThe RTRIM() function removes trailing spaces from a string.SyntaxRTRIM(string)Parameter Values...
❮ MySQL Functions Example Convert the text to upper-case: SELECTUCASE("SQL Tutorial is FUN!"); Try it Yourself » Definition and Usage The UCASE() function converts a string to upper-case. Note:This function is equal to theUPPER()function. ...
❮ MySQL Functions Example Return the length of the string: SELECTCHAR_LENGTH("SQL Tutorial")ASLengthOfString; Try it Yourself » Definition and Usage The CHAR_LENGTH() function return the length of a string (in characters). Note:This function is equal to theCHARACTER_LENGTH()function. ...
MySQL RPAD() Function❮ MySQL FunctionsExampleRight-pad the string with "ABC", to a total length of 20:SELECT RPAD("SQL Tutorial", 20, "ABC"); Try it Yourself » Definition and UsageThe RPAD() function right-pads a string with another string, to a certain length....