mysql

Check if an element is contained in the values ​(array) of a json column in MySql

五迷三道 提交于 2021-02-09 07:38:38
问题 I have the following values ​​inside a cell of a json column in MySql: { "produttori": [ "8", "9" ], "articoli_alternativi": [ "3", "9" ], "articoli_accessori": [ "5", "6", "7", "8" ], "tecnologie": [], "fornitori": [ "9", "8" ], "classificazioni": [ "3", "4" ] } I would like to make a query that extracts data based on the existence of a value in the array at the fornitori key. For now I've tried this: query = 'SELECT nome, formulati_commerciali FROM articolo WHERE JSON_CONTAINS(JSON_EXTRACT

Check if an element is contained in the values ​(array) of a json column in MySql

倖福魔咒の 提交于 2021-02-09 07:32:46
问题 I have the following values ​​inside a cell of a json column in MySql: { "produttori": [ "8", "9" ], "articoli_alternativi": [ "3", "9" ], "articoli_accessori": [ "5", "6", "7", "8" ], "tecnologie": [], "fornitori": [ "9", "8" ], "classificazioni": [ "3", "4" ] } I would like to make a query that extracts data based on the existence of a value in the array at the fornitori key. For now I've tried this: query = 'SELECT nome, formulati_commerciali FROM articolo WHERE JSON_CONTAINS(JSON_EXTRACT

MySQL INSERT SELECT not Inserting

北战南征 提交于 2021-02-09 07:30:22
问题 I am trying tor un an insert select that looks like this: INSERT INTO users_extension_usage (userid, extensionid, complete) SELECT '3', extensions.id FROM extensions WHERE extensions.folder='definitions', '1' however it has a problem when I run it in phpMyAdmin that refers to the '1': #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' '1'' at line 2 I have tried many different combinations of SELECT,

Json string from LocalDateTime(java 8) in Spring MVC

徘徊边缘 提交于 2021-02-09 07:10:59
问题 have trouble in LocalDateTime(Java 8) Formatting in Spring MVC framework my VO is like under code in mySQL w_date field is DATETIME and recode like "2015-12-25 23:18:22" public class HistoryBoard { @JsonFormat(pattern="yyyy-MM-dd") @DateTimeFormat(iso = DateTimeFormat.ISO.TIME) private LocalDateTime w_date; public LocalDateTime getW_date() { return w_date; } public HistoryBoard setW_date(String w_date) { DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S"); this.w_date

Json string from LocalDateTime(java 8) in Spring MVC

最后都变了- 提交于 2021-02-09 07:08:38
问题 have trouble in LocalDateTime(Java 8) Formatting in Spring MVC framework my VO is like under code in mySQL w_date field is DATETIME and recode like "2015-12-25 23:18:22" public class HistoryBoard { @JsonFormat(pattern="yyyy-MM-dd") @DateTimeFormat(iso = DateTimeFormat.ISO.TIME) private LocalDateTime w_date; public LocalDateTime getW_date() { return w_date; } public HistoryBoard setW_date(String w_date) { DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S"); this.w_date

error connecting mysql 8 with django

本小妞迷上赌 提交于 2021-02-09 07:05:32
问题 I am using python 3.6, mysql-community-server-8.0.11-1 and using fedora 28 I am trying to setup mysql for my django application But I am receiving Segmentation fault (myblogvenv) [saurabhkumar@localhost myblog]$ python manage.py runserver Performing system checks... Segmentation fault (core dumped) If I use the default sqlite3 database, server comes up. Also when I run django-admin dbshell I get the following error: (myblogvenv) [saurabhkumar@localhost myblog]$ django-admin dbshell Traceback

error connecting mysql 8 with django

大城市里の小女人 提交于 2021-02-09 07:03:58
问题 I am using python 3.6, mysql-community-server-8.0.11-1 and using fedora 28 I am trying to setup mysql for my django application But I am receiving Segmentation fault (myblogvenv) [saurabhkumar@localhost myblog]$ python manage.py runserver Performing system checks... Segmentation fault (core dumped) If I use the default sqlite3 database, server comes up. Also when I run django-admin dbshell I get the following error: (myblogvenv) [saurabhkumar@localhost myblog]$ django-admin dbshell Traceback

Json string from LocalDateTime(java 8) in Spring MVC

折月煮酒 提交于 2021-02-09 07:02:33
问题 have trouble in LocalDateTime(Java 8) Formatting in Spring MVC framework my VO is like under code in mySQL w_date field is DATETIME and recode like "2015-12-25 23:18:22" public class HistoryBoard { @JsonFormat(pattern="yyyy-MM-dd") @DateTimeFormat(iso = DateTimeFormat.ISO.TIME) private LocalDateTime w_date; public LocalDateTime getW_date() { return w_date; } public HistoryBoard setW_date(String w_date) { DateTimeFormatter sdf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.S"); this.w_date

php and mysql, best practices

大城市里の小女人 提交于 2021-02-09 05:42:26
问题 I started working with php and mysql today. Basically, what I have, is an empty page with pieces that I fill in from looking up an id in a database. So on my home page I have an url that looks like this: <a href="content/display.php?id=id1"> And then in my display.php I have this: <?php include '../includes/header.php'; $id = $_GET['id']; $mysqli = new mysqli('localhost','username','password','dbname'); if($result = $mysqli->query("SELECT * FROM portfolio WHERE id='".$id."'")) { while($row =

php and mysql, best practices

眉间皱痕 提交于 2021-02-09 05:41:09
问题 I started working with php and mysql today. Basically, what I have, is an empty page with pieces that I fill in from looking up an id in a database. So on my home page I have an url that looks like this: <a href="content/display.php?id=id1"> And then in my display.php I have this: <?php include '../includes/header.php'; $id = $_GET['id']; $mysqli = new mysqli('localhost','username','password','dbname'); if($result = $mysqli->query("SELECT * FROM portfolio WHERE id='".$id."'")) { while($row =