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.
import os
os.name
# nt, posix
import platform
platform.system()
# 'Windows', 'Linux', 'Darwin'
platform.release()
# Linux, Windows, Windows, Darwin
'2.6.22-15-generic', 'Vista' ,'10', '8.11.1'
# Example from https://stackoverflow.com/questions/1854/python-what-os-am-i-running-on
from sys import platform as _platform
if _platform == "linux" or _platform == "linux2":
# linux
elif _platform == "darwin":
# MAC OS X
elif _platform == "win32":
# Windows
elif _platform == "win64":
# Windows 64-bit
244
T-SQL
Datenbank
SQL SELECT Statische Werte
SELECT
*
FROM (
VALUES
(1, 2),
(3, 4)
) AS q (col1, col2)
GO
-- the same as:
SELECT 1 AS col1, 2 AS col2 UNION ALL
SELECT 3 AS col1, 4 AS col2
GO
-- col1 | col2
-- ===========
-- 1 | 2
-- -----------
-- 3 | 4
245
PL/pgSQL
Datenbank
SQL SELECT Statische Werte
SELECT
*
FROM (
VALUES
(1, 2),
(3, 4)
) AS q (col1, col2)
;
-- the same as:
SELECT 1 AS col1, 2 AS col2 UNION ALL
SELECT 3 AS col1, 4 AS col2
;
-- col1 | col2
-- ===========
-- 1 | 2
-- -----------
-- 3 | 4
239
PHP
Strings
Text in Großschrift oder Kleinschrift
//http://us2.php.net/manual/de/function.strtoupper.php
$myString = "my lovely Mr Singing Club";
echo strtoupper($myString);
// MY LOVELY MR SINGING CLUB
//http://php.net/manual/de/function.strtolower.php
echo strtolower($myString);
240
Python
Strings
Text in Großschrift oder Kleinschrift
myString = "my lovely Mr Singing Club"
print myString.upper()
// MY LOVELY MR SINGING CLUB
print myString.lower()
241
T-SQL
Strings
Text in Großschrift oder Kleinschrift
SELECT
'my lovely Mr Singing Club' AS myString
,UPPER('my lovely Mr Singing Club') AS myStringUpper
,LOWER('my lovely Mr Singing Club') AS myStringLower
-- myString: my lovely Mr Singing Club
-- myStringUpper: MY LOVELY MR SINGING CLUB
-- myStringLower: my lovely mr singing club
233
MySQL
Datum, Zeit
Datum/Uhrzeit berechnen
SELECT DATE_ADD(now(),INTERVAL -45 DAY) AS calculated_Day;
-- ^^^
-- Type
--
-- Available Types:
-- MICROSECOND
-- SECOND
-- MINUTE
-- HOUR
-- DAY
-- WEEK
-- MONTH
-- QUARTER
-- YEAR
-- SECOND_MICROSECOND
-- MINUTE_MICROSECOND
-- MINUTE_SECOND
-- HOUR_MICROSECOND
-- HOUR_SECOND
-- HOUR_MINUTE
-- DAY_MICROSECOND
-- DAY_SECOND
-- DAY_MINUTE
-- DAY_HOUR
-- YEAR_MONTH
232
MySQL
Datum, Zeit
Datum/Uhrzeit zusammensetzen
SELECT MAKETIME(19,53,20) AS TIME;
-- 19:53:20
SELECT MAKEDATE(2014,120) AS DATE;
-- ^^^
-- Day of Year
-- 2014-04-30
225
PHP
Systeminfo
Hostnamen ermitteln
echo gethostname();
// prints myComputer1 or srvLinux1