with cte as (
select p.id, p.parent_id, o.name from page p
left join page_options po on po.page_id = p.id
left join options o on o.id = po.option_id
)
select coalesce(o.name, (select o.name from cte where id = cte.parent_id) ) from cte
where id = :ID
--строим все возможные значения даты-времени через рекурсивную CTE
with dates as (
select convert(datetime, '20190101') AS cdate --начальная дата
UNION ALL
SELECT DATEADD(minute, 1, cdate) AS cdate --прибавляем по минуте
FROM dates
WHERE cdate <'20190102' --конечная дата
)
select * from dates d
left join tokens t
on t.ts = d.cdate
where t.ts is null --смотрим пропуски
option (maxrecursion 0)
with
d as (
select idGood, sum(amount) total from delivery group by idGood
),
s as (
select idGood, sum(amount) total from sale group by idGood
)
select d.idGood, d.total - isnull(s.total, 0) as amounts
from d left join s on s.idGood = s.idGood
SELECT
aicraft.id,auto.uri, auto.expires_at, auto.created_at, auto.updated_at
FROM aicraft
LEFT OUTER JOIN aicraft ON aicraft_id = auto.id
INTO OUTFILE '/tmp/result.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
let currentTime = new Date().getHours();
if (currentTime >= 23 || currentTime <= 6) {
console.log('match');
} else {
console.log('not match');
}
lsof -i:8181
kill -9 $(lsof -t -i:8181
./app &
echo $! > pidfile
public void clickHandler(object sender, System.EventArgs e) {...}
button1.Click += new EventHandler(clickHandler);
button2.Click += new EventHandler(clickHandler);
button3.Click += new EventHandler(clickHandler);
foreach (Control ctrl in myGroupBox.Controls)
{
ctrl.Click += new EventHandler(clickHandler);
}
$entity = '';
$comp_name '';
$db = DB::connection()->getPdo();
$stmt = $db->prepare("exec [foo].[prcBar] 'userlogin', 'userpass', ?, ?");
$stmt->bindParam(1, $entity, PDO::PARAM_INPUT_OUTPUT);
$stmt->bindParam(2, $comp_name, PDO::PARAM_INPUT_OUTPUT);
$stmt->execute();
print($entity);
print($comp_name);