Manage PlItems

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.

Advanced Search
Displaying 281-290 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
283Yii2DatenbankVerzeichnis erstellen<?php // Example as SQL: // SELECT * FROM MainTable // WHERE fieldA=5 AND fieldB IN (SELECT id FROM SubTable WHERE fieldC=551) $fieldC = 551; $SubTable_idQry = SubTable::find()->select('id')->where(['fieldC' => $fieldC]); // Static way: $fieldA = 5; // As result: $fieldA = ThirdTable::find() ->select('fieldA_Reference') ->where(['fieldC' => $fieldC]) ->one(); $MainTableResultQry = MainTable::find() ->where(['in', 'fieldB', $SubTable_idQry]) ->andWhere(['fieldA' => $fieldA]) ->all(); ?>View Update Delete
284Yii2DatenbankAbfrage mit Aggregration<?php /* // Example as SQL SELECT FieldA ,COUNT(FieldA) as cnt FROM MainTable WHERE FieldA = 5 GROUP BY FieldA */ $MainTableResultQry = MainTable::find() ->select(['FieldA', 'COUNT(FieldA) as cnt']) ->where(['FieldA' => 5]) ->groupBy(['FieldA']) ->createCommand() ->queryAll(); ?>View Update Delete
285Bash ScriptFilehandlingApplikations-/Script-Verzeichnis ermitteln#!/bin/sh # The script is located in /tmp/abc/myscript.sh export AppPath=$(dirname $0) echo $0 # /tmp/abc/myscript.sh echo $AppPath # /tmp/abcView Update Delete
286Yii2Yii2-ActiveQueryAbfrage mit Subselect<?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(); ?>View Update Delete
287MySQLStringsAnzahl 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 ; View Update Delete
288PL/pgSQLDatum, ZeitGestriges DatumSELECT (now())::date SELECT (now() + interval '-1 day')::dateView Update Delete
289PL/pgSQLStringsFührende Nullen vor einer ZahlWITH 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_exampleView Update Delete
290T-SQLDatum, ZeitAktuelles Datum/UhrzeitDECLARE @newDT DATETIME SET @newDT = CAST('2021-01-01 01:23:45' AS DATETIME) SELECT FORMAT(GETDATE(), 'yyyy-MM-dd', 'En') SELECT FORMAT(GETDATE(), 'yyyy-MM-dd HH:mm:ss', 'En')View Update Delete
291SQLiteStringsFührende Nullen vor einer ZahlWITH 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 ;View Update Delete
292Yii2Yii2-InternalPrüfen ob aktueller User ein Gast istuse Yii; if (! \Yii::$app->user->isGuest) { $result = "User is logged in. User is no guest" }View Update Delete