You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.
# In PowerShell such variables are called: Here-Strings
$mySQLString = @"
SELECT 1
FROM dbo.TestTable
WHERE 1=1
"@
273
T-SQL
Strings
Leerzeichen vor/hinter String entfernen
SELECT LTRIM(RTRIM(' x text x '))
274
Python
Strings
Leerzeichen vor/hinter String entfernen
myText = " x text x \r\n"
print myText.strip()
31
PHP
Strings
String nach Delimenter zerlegen
$myString = "A;B;C;D;E";
$myPieces = explode(";",$myString); // erzeigt ein Array mit den einzelnen Zeichen
echo $myPieces[2]; // gibt C aus
287
MySQL
Strings
Anzahl an Zeichen in einem String ermitteln
-- Gets only result with 4 "/" in the the field relativePath
SELECT
id
,albumRoot
,relativePath
,date
,caption
,collection
,icon
,LENGTH(relativePath) - LENGTH(REPLACE(relativePath,'/','')) AS `occurrences`
FROM Albums
WHERE LENGTH(relativePath) - LENGTH(REPLACE(relativePath,'/',''))=4
;
32
Java
Strings
String nach Delimenter zerlegen
String myString = new String;
String[] myPieces = new String;
myString = "A;B;C;D;E";
myPieces = myString.split(";"); // erzeugt ein Arrey mit den einzelnen Zeichen
System.out.println(myPieces[2]); // gibt C aus
33
Mumps
Strings
String nach Delimenter zerlegen
myString="A;B;C;D;E"
Write !,$Piece(myString,";",3) // gibt C aus
289
PL/pgSQL
Strings
Führende Nullen vor einer Zahl
WITH cte_example AS
(
SELECT 5 AS int_example UNION ALL
SELECT 10 AS int_example UNION ALL
SELECT 50 AS int_example
)
SELECT
int_example,
RPAD(int_example::text, 3, '0'),
LPAD(int_example::text, 3, '0')
FROM cte_example
291
SQLite
Strings
Führende Nullen vor einer Zahl
WITH cte_example AS
(
SELECT 5 AS int_example UNION ALL
SELECT 10 AS int_example UNION ALL
SELECT 50 AS int_example
)
SELECT
int_example,
substr('0000000'||ROW_NUMBER() OVER(ORDER BY int_example)||'00', -8, 8) AS example_result
FROM cte_example
;