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.
@echo off
SET myVariable=This is my content
SET myPathVariableWithBlanks="C:\Temp\Path With Blanks\File.txt"
echo %myVariable%
REM This is my content
echo %myPathVariableWithBlanks%
REM "C:\Temp\Path With Blanks\File.txt"
198
Batch
Konsolenverwaltung
Einlesen Konsoleneingabe
@echo off
SET mydir=%CD%
set /p number=search this number?:
echo %number% > "%mydir%\lastnumbersearched.txt"
echo dir/b/s *%number%*.*
echo.
echo.
dir/b/s *%number%*.*
echo.
echo.
pause
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
183
Batch
Variablen
Wert einer Variable zuweisen
@echo off
cd C:\Temp
REM Aktuelles Verzeichnis in einer Variable setzen
SET mydir="Mein Verzeichnis lautet %CD%"
echo %mydir%
REM "Mein Verzeichnis lautet C:\Temp"
<?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();
?>
284
Yii2
Datenbank
Abfrage 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();
?>
286
Yii2
Yii2-ActiveQuery
Abfrage 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();
?>
7
Mumps
Datum, Zeit
Aktuelles Datum/Uhrzeit
; The first integer is the number of days since December 31, 1840, where day 1 is January 1, 1841. The second integer is the number of seconds since midnight of the current day
Set h=$horolog
S h=$H
W !,h ; gibt aus 61793,34937 was dem Datum 2010-03-08 und der Uhrzeit 09:42:17 entspricht