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.
SELECT COALESCE(MyColumn1, 1.0) AS MyColumnWithoutNULL;
222
MySQL
Datenbank
NULL Wert eines Feldes übersteuern
SELECT IFNULL(MyColumn1, 1) AS MyColumnWithoutNULL;
176
Bash Script
Filehandling
Prüfen ob Datei existiert
# http://wiki.ubuntuusers.de/Shell/Bash-Skripting-Guide_f%C3%BCr_Anf%C3%A4nger#If-Else-Anweisung
#!/bin/bash
filePath="/home/myUser/test.txt"
if [ -f ${filePath} ]
then
echo "There it is! ;-)"
else
echo "Whow, file is missing at this place :-("
fi
177
Delphi
Filehandling
Prüfen ob Datei existiert
procedure TForm1.CheckIfFileExists();
var
filePath : String;
begin
filePath:='C:\User\myUser\text.txt';
if FileExists(filePath) then
begin
ShowMessage('There it is! ;-)');
end
else
begin
ShowMessage('Whow, file is missing at this place :-(');
end;
end;
178
C#
Filehandling
Prüfen ob Datei existiert
String filePath = "C:\\User\\myUser\\text.txt";
if (System.IO.File.Exists(filePath))
{
MessageBox.Show("There it is! ;-)");
}
else
{
MessageBox.Show("Whow, file is missing at this place :-(");
}
179
PHP
Filehandling
Prüfen ob Datei existiert
$filePath = "/home/myUser/test.txt";
if (file_exists($filePath))
{
echo "There it is! ;-)"
}
else
{
"Whow, file is missing at this place :-("
}
184
Batch
Filehandling
Prüfen ob Datei existiert
@echo off
SET checkFileExists="C:\Temp\myFile.txt"
IF exist %checkFileExists% GOTO :EXISTS
GOTO :EXISTSNOT
:EXISTS
echo There it is :-)
GOTO :END
:EXISTSNOT
echo Sorry, the file isn't there :-(
GOTO :END
:END
echo End of program
192
Python
Filehandling
Prüfen ob Datei existiert
import os
filePath="/home/myUser/test.txt"
if (os.path.isfile(filePath)):
print "There it is! ;-)"
else:
print "Whow, file is missing at this place :-("
172
SQLite
Datum, Zeit
Zeitdifferenz
-- http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions
SELECT (strftime('%s','now') - strftime('%s',date('now','-1 day'))) AS Seconds
-- https://stackoverflow.com/questions/289680/difference-between-2-dates-in-sqlite
SELECT CAST(JulianDay('now') - JulianDay(MAX(datetime_field_in_table)) * 24 * 60 AS Integer) AS diff_minutes FROM example_table
173
T-SQL
Datum, Zeit
Zeitdifferenz
--http://msdn.microsoft.com/de-de/library/ms189794.aspx
SELECT DATEDIFF(second, '2005-12-31 23:59:59.9999999', '2006-01-01 00:00:00.0000000') AS Seconds