UPDATE baza SET xfields = REGEXP_REPLACE(xfields, 'knopka-skachat-fayl|[0-9]+||', '');
UPDATE table SET content = CONCAT(content, ' bla_2') WHERE id = 1
UPDATE table SET content = CONCAT_WS(' - ', content, 'bla_2') WHERE id = 1
mysql> SELECT REGEXP_REPLACE('a b c', 'b', 'X');
+-----------------------------------+
| REGEXP_REPLACE('a b c', 'b', 'X') |
+-----------------------------------+
| a X c |
+-----------------------------------+
UPDATE `site_content` SET `content` = REGEXP_REPLACE(content, 'title="Иллюстрация [0-9]+"', '')
echo "[";
while($hero2 = mysqli_fetch_assoc($hero1)){
$time_now = strtotime($hero2['cron1']);
$time_need = strtotime($hero2['cron2']);
if ($time_need>=$time_now ){
$t_s= date("H:i ",75600-($time_need-$time_now));
}
else {
$t_s= date("H:i ",75600-($time_now-$time_need));
}
echo str_replace(":",".",$t_s).",";
}
echo "]";
echo $post1["COUNT(*)"]
SELECT COUNT(email) AS emails FROM clients WHERE email = 'bill@microsoft.com';
SELECT * FROM shop_order
INNER JOIN contact_data USING(contact_id)
WHERE shop_order.state_id='paid' AND contact_data.value='Москва'
INSERT IGNORE INTO dialogs (dialog_id, user_id) VALUES (1, user_1)
INSERT INTO t1 (a,b,c) VALUES (1,2,3)
ON DUPLICATE KEY UPDATE c=c+1;
Можно ли средствами SQL задать значение в выводе 0 всем остальным записям, которые < 3?
ALTER TABLE dates ADD UNIQUE keyword('date', 'id');
INSERT IGNORE INTO dates (...) VALUES