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.
CREATE TABLE newDestinationTable AS
SELECT * FROM oldSourceTable
264
SQLite
Datenbank
Eine Menge B reduziert um Menge A
-- Es soll die Menge an Datensätze ausgegeben reduziert um eine andere Menge (Rest)
-- Die einzelnen Tabellen oder Subqueries müssen die gleichen Spalten im Statement haben
SELECT
FieldA
,FieldB
,FieldC
FROM myTable1
EXCEPT
SELECT
FieldA
,FieldB
,FieldC
FROM myTable2
265
T-SQL
Datenbank
Eine Menge B reduziert um Menge A
-- Es soll die Menge an Datensätze ausgegeben reduziert um eine andere Menge (Rest)
-- Die einzelnen Tabellen oder Subqueries müssen die gleichen Spalten im Statement haben
SELECT
FieldA
,FieldB
,FieldC
FROM myTable1
EXCEPT
SELECT
FieldA
,FieldB
,FieldC
FROM myTable2
266
MS Access VBA
Array
Dictionary Basics
' empty dict
Dim myDict As Dictionary
Set myDict = New Dictionary
' some static values
myDict.Add "key1", "value1"
myDict.Add "key2", "valueY"
myDict.Add "keyX", "value98"
' update a key programmatically
myDict.Remove "key1"
myDict.Add "key1", "new value"
' iterate
Dim strKey As Variant
Dim current_key As String
Dim strValue As String
For Each strKey In myDict.Keys()
current_key = strKey
strValue = myDict.Keys(strKey)
Next
' Exists
If myDict.Exists(strKey) Then
Debug.Print "yes"
End If
' get an specific item
Dim subdict As String
subdict = myDict.Keys("key2")
# valueY
267
PowerShell
Array
Dictionary Basics
# empty Hashtable
$myDict = @{}
# some static values
$myDict.Add("key1", "value1")
$myDict.Add("key2", "valueY")
$myDict.Add("keyX", "value98")
# update a key programmatically
$myDict.Remove("key1")
$myDict.Add("key1", "new value")
# iterate
Foreach ($key in $myDict.keys) {
$strKey = $key
$strValue = $Parameter[$key]
}
# Exists
If ($myDict.ContainsKey("key1") -eq $true) {
write-host "yes"
}
# get an specific item
$subdict = $myDict("key2")
# valueY
268
T-SQL
Encoding / Decoding
Checksumme
SELECT
[CHECKSUM_1] = CHECKSUM(Column1, Column2)
FROM
TableA
269
PL/pgSQL
Datenbank
UPDATE SQL mit JOIN
UPDATE TableToBeUpdated
SET myField1 = 'Update this field'
FROM
(
SELECT * FROM JoinedTable
WHERE cond1 = 1
)
J
WHERE J.ID = TableToBeUpdated.ID
;
270
T-SQL
Datenbank
UPDATE SQL mit JOIN
UPDATE UPD_TABLE
SET UPD_TABLE.myField1 = 'Update this field'
FROM TableToBeUpdated UPD_TABLE
LEFT JOIN
(
SELECT * FROM JoinedTable
WHERE cond1 = 1
)
J
WHERE J.ID = UPD_TABLE.ID
;
271
MySQL
Datenbank
UPDATE SQL mit JOIN
UPDATE TableToBeUpdated UPD_TABLE
INNER JOIN JoinedTable J ON J.id = UPD_TABLE.id
SET UPD_TABLE.myField1 = 'Update this field'
;
272
MS Access SQL
Datenbank
NULL Wert eines Feldes übersteuern
SELECT
FieldA
,Nz([FieldB,"This field is null") As FieldB_Nz
FROM TableA