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.
<?php
/*
SQL Example:
SELECT * FROM `Cities`
WHERE
(`postalcode_id` IN (SELECT `id` FROM `postalcodes` WHERE `postalcode`='12345')
)
OR
(`region_id` IN (SELECT `id` FROM `regions` WHERE `region`='North')
)
*/
$active_query_postalcodes_For_Subselect = \app\models\Postalcodes::find()->select("id")->where(["postalcodes" => '12345']); // Attention! No "->all()" at the end to create a subselect!
$active_query_regions_For_Subselect = \app\models\Regions::find()->select("id")->where(["region" => 'North']); // Attention! No "->all()" at the end to create a subselect!
$model = new \app\models\Cities();
$all_Cities_With_IN_and_OR = $model::find()
->where(['in', "postalcode_id", $active_query_postalcodes_For_Subselect])
->orWhere(['in', "region_id", $active_query_regions_For_Subselect])
->all();
?>
292
Yii2
Yii2-Internal
Prüfen ob aktueller User ein Gast ist
use Yii;
if (! \Yii::$app->user->isGuest)
{
$result = "User is logged in. User is no guest"
}
SELECT
CURRENT_TIMESTAMP() AS today_timestamp
, DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY) AS yesterday_as_date
294
BigQuery
Datenmengen
Differenzen anzeigen
WITH a AS (
SELECT * FROM UNNEST([1,2,3,4]) AS n
),
b AS (
SELECT * FROM UNNEST([4,5,6,7]) AS n
)
SELECT * FROM a
EXCEPT DISTINCT -- <------------------
SELECT * FROM b
SELECT FORMAT_TIMESTAMP("%FT%H:%M:%E3S", CURRENT_DATETIME()) AS iso_date_string
300
BigQuery
Datenbank
UPDATE SQL mit JOIN
UPDATE
`project.dataset.table1` t1
SET
t1.target_column = t2.source_column
FROM
`project.dataset.table2` t2
WHERE
t1.join_key = t2.join_key;
296
EXASOL
Datenmengen
Differenzen anzeigen
WITH a AS (
SELECT 1 AS n UNION ALL
SELECT 2 AS n UNION ALL
SELECT 3 AS n UNION ALL
SELECT 4 AS n
),
b AS (
SELECT 4 AS n UNION ALL
SELECT 5 AS n UNION ALL
SELECT 6 AS n UNION ALL
SELECT 7 AS n
)
SELECT * FROM a
EXCEPT -- <------------------------------
SELECT * FROM b
298
EXASOL
Datum, Zeit
Aktuelles Datum/Uhrzeit
SELECT TO_CHAR(CURRENT_TIMESTAMP, 'YYYY-MM-DDTHH24:MI:SS.FF3') AS iso_date_string