As the URL is like any other URL, special characters such as those that may be used in the password need to be URL encoded to be parsed correctly.
$stmt = $connection->prepare("INSERT INTO UserStreetid(Id, Streetid) VALUES (?, ?) ON DUPLICATE KEY UPDATE Streetid = ?");
$stmt->bind_param("iii", $datatopush[0], $datatopush[1], $datatopush[1]);
if (!$stmt->execute())
echo"Error:".$qpush."<br>".mysqli_error($connection);
If you are already running mysql, you can execute an SQL script file using the source command or \. command:
mysql> source file_name mysql> \. file_name
create table t (col jsonb);
create index ix_t_col using gin(to_tsvector('pg_catalog.english', jsonb_path_query_array(col, '$.obj.TEXT')));
insert into t values('{
"obj": [
{
"TEXT": "These functions act like their counterparts described above without the _tz suffix, except that these functions support comparisons of date/time values that require timezone-aware conversions.",
"key1": 77,
"key2": "a"
},
{
"TEXT": "Returns target with new_value inserted. If the item designated by the path is an array element, new_value will be inserted before that item if insert_after is false (which is the default), or after it if insert_after is true. If the item designated by the path is an object field, new_value will be inserted only if the object does not already contain that key",
"key1": 99,
"key2": false
}
]
}');
select ts_headline(col, 'function'::tsquery),
ts_headline(arr, 'function'::tsquery)
from (
select col, jsonb_path_query_array(col, '$.obj.TEXT') arr,
to_tsvector('pg_catalog.english', jsonb_path_query_array(col, '$.obj.TEXT')) tsv
from t
) q
where tsv @@ 'function'::tsquery;
jsonb_path_query_array(col, '$.obj.TEXT')
- выделяет все, что у вас по ключу TEXT в массив. Дальше он индексируется "--" . $boundary . "--";
.a**num
будет очень медленным. В питоне есть функция pow, которая имеет волшебный третий параметр и умеет вычислять возведение в степень по модулю очень быстро. PostgreSQL 9.4.13 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-4), 64-bit
Django supports PostgreSQL 10 and higher. psycopg2 2.8.4 or higher is required, though the latest release is recommended.
host all all all md5
.CREATE OR REPLACE FUNCTION public.foo(str character varying)
RETURNS SETOF record
LANGUAGE plpgsql
AS $$
BEGIN
IF str = 'i' THEN
RETURN QUERY SELECT i, i*i FROM generate_series(1, 10) i;
ELSE
RETURN QUERY SELECT i, SQRT(i::float) FROM generate_series(1, 10) i;
END IF;
END;
$$
# select * from foo('i') as (key int, value int);
key | value
-----+-------
1 | 1
2 | 4
3 | 9
4 | 16
5 | 25
6 | 36
7 | 49
8 | 64
9 | 81
10 | 100
(10 rows)
# select * from foo('x') as (key int, value float);
key | value
-----+--------------------
1 | 1
2 | 1.4142135623730951
3 | 1.7320508075688772
4 | 2
5 | 2.23606797749979
6 | 2.449489742783178
7 | 2.6457513110645907
8 | 2.8284271247461903
9 | 3
10 | 3.1622776601683795
(10 rows)
$ppk =(string)$pickup_date[0]че ж 0-то? Уж скорее так:
$ppk =(string)$pickup_date["[]"]...
SELECT
t.str,
SUM(n)
FROM (
(SELECT str1 as str, COUNT(*) as n FROM tableName WHERE date BETWEEN '2021-01-01' AND '2021-12-31' GROUP BY str1)
UNION
(SELECT str2 as str, COUNT(*) as n FROM tableName WHERE date BETWEEN '2021-01-01' AND '2021-12-31' GROUP BY str2)
) as t
GROUP BY t.str