"9 сентября 2012 Microsoft объявила о прекращении дальнейшего развития Forefront TMG. Основная поддержка будет прекращена после 14 апреля 2015 года, а расширенная поддержка закончится 14 апреля 2020 года. Продукт не будет доступен для приобретения после 1 декабря 2012 года[2]. На сегодняшний день доступен только в составе аппаратных решений OEM партнёров Microsoft. "
DO UPDATE SET ... WHERE condition
melkij=> create temp table foo (item int primary key, d date, price numeric);
CREATE TABLE
melkij=> insert into foo values (1, '2021-07-30', 100) on conflict (item) do update set price = excluded.price, d = excluded.d where excluded.d > foo.d;
INSERT 0 1
melkij=> table foo;
item | d | price
------+------------+-------
1 | 2021-07-30 | 100
(1 строка)
melkij=> insert into foo values (1, '2021-08-01', 110) on conflict (item) do update set price = excluded.price, d = excluded.d where excluded.d > foo.d;
INSERT 0 1
melkij=> table foo;
item | d | price
------+------------+-------
1 | 2021-08-01 | 110
(1 строка)
melkij=> insert into foo values (1, '2021-07-20', 80) on conflict (item) do update set price = excluded.price, d = excluded.d where excluded.d > foo.d;
INSERT 0 0
melkij=> table foo;
item | d | price
------+------------+-------
1 | 2021-08-01 | 110
(1 строка)
SET `cte_max_recursion_depth` = 10000;
INSERT INTO `test` (`DATE_CREATE`, `DATE_UPDATE`, `ACTIVE`, `USER_ID`, `VALUE`)
WITH RECURSIVE `cte` (`DATE_CREATE`, `DATE_UPDATE`, `ACTIVE`, `USER_ID`, `VALUE`) AS (
SELECT NOW(), NOW(), 1, 1, 1 AS `VALUE`
UNION
SELECT NOW(), NOW(), 1, 1, `VALUE`+1 FROM `cte` WHERE `VALUE` < 9999
)
SELECT *
FROM `cte`
SELECT reltuples FROM pg_class WHERE relname = "table"
var Telegram = {
token: null,
to: null,
message: null,
proxy: null,
parse_mode: null,
sendMessage: function() {
var params = {
chat_id: Telegram.to,
text: Telegram.message,
disable_web_page_preview: true,
disable_notification: false
},
data,
response,
request = new CurlHttpRequest(),
url = 'https://api.telegram.org/bot' + Telegram.token + '/sendMessage';
if (Telegram.parse_mode !== null) {
params['parse_mode'] = Telegram.parse_mode;
}
if (Telegram.proxy) {
request.SetProxy(Telegram.proxy);
}
request.AddHeader('Content-Type: application/json');
data = JSON.stringify(params);
// Remove replace() function if you want to see the exposed token in the log file.
Zabbix.Log(4, '[Telegram Webhook] URL: ' + url.replace(Telegram.token, '<TOKEN>'));
Zabbix.Log(4, '[Telegram Webhook] params: ' + data);
response = request.Post(url, data);
Zabbix.Log(4, '[Telegram Webhook] HTTP code: ' + request.Status());
try {
response = JSON.parse(response);
}
catch (error) {
response = null;
}
if (request.Status() !== 200 || typeof response.ok !== 'boolean' || response.ok !== true) {
if (typeof response.description === 'string') {
throw response.description;
}
else {
throw 'Unknown error. Check debug log for more information.'
}
}
}
}
try {
var params = JSON.parse(value);
if (typeof params.Token === 'undefined') {
throw 'Incorrect value is given for parameter "Token": parameter is missing';
}
Telegram.token = params.Token;
if (params.HTTPProxy) {
Telegram.proxy = params.HTTPProxy;
}
if (['Markdown', 'HTML', 'MarkdownV2'].indexOf(params.ParseMode) !== -1) {
Telegram.parse_mode = params.ParseMode;
}
Telegram.to = params.To;
Telegram.message = params.Subject + '\n' + params.Message;
Telegram.sendMessage();
return 'OK';
}
catch (error) {
Zabbix.Log(4, '[Telegram Webhook] notification failed: ' + error);
throw 'Sending failed: ' + error + '.';
}
$sql = mysqli_query($connection, "UPDATE `users` SET '{$userInfo['first_name']}', '{$userInfo['last_name']}', '{$userInfo['photo_big']}'");
UPDATE
col1 = value1,
col2 = value2,
...
WHERE
colN = valueN
...
"INSERT INTO `users` (`id`, `vk_link`, `first_name`, `last_name`, `avatar`, `joined`, `group_user`) VALUES (NULL, '{$userInfo['screen_name']}', '{$userInfo['first_name']}', '{$userInfo['last_name']}', '{$userInfo['photo_big']}', CURRENT_TIMESTAMP, NULL)")
... WHERE vk_link='{$userInfo['screen_name']}'
use information_schema
select concat_ws(' ', 'update', table_name, 'set', column_name, '= replace(', column_name, ', ''search'', ''replace'' );')
from columns
where table_schema = 'mysql'
and (data_type = 'varchar' or data_type like '%text');
table_schema = 'mysql'
на нужную вам базу)+------------------------------------------------------------------------------------------------------------------------+
| concat_ws(' ', 'update', TABLE_NAME, 'set', COLUMN_NAME, '= REPLACE(', COLUMN_NAME, ', ''search'', ''replace'' );') |
+------------------------------------------------------------------------------------------------------------------------+
| update component set component_urn = REPLACE( component_urn , 'search', 'replace' ); |
| update engine_cost set comment = REPLACE( comment , 'search', 'replace' ); |
| update engine_cost set cost_name = REPLACE( cost_name , 'search', 'replace' ); |
| update engine_cost set engine_name = REPLACE( engine_name , 'search', 'replace' ); |