Questions tagged [mysql]

MySQL is a free, open source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). DO NOT USE this tag for other DBs such as SQL Server, SQLite etc. These are different DBs which all use SQL to manage the data.

0
votes
0answers
4 views

MySQL - get users who placed 25th order during period

I have users and orders tables with this structure (simplified for question): USERS userid ORDERS id date (order placed date) user_id I need to get array of users (array of userid) who placed ...
0
votes
0answers
6 views

PHP and MYSQL Data Insertion on Windows and Ubuntu

I'm migrating my full php project from windows to ubuntu 18.04.2 LTS. I'm using xampp for apache7 and mysql v.14 services in windows and Im running apache and mysql standalone services in ubuntu. The ...
-1
votes
0answers
10 views

Friendship recommendation based on friends of friends who's not my friend

I am having a MySQL Table which is storing friendship relationships in the following structure: ID | acceptDate | requesterId | receiverId Now I want to give the user friendship recommendations as a ...
-4
votes
0answers
14 views

php mysql query adds quotes in the end

I have set up a query as such: $query ='SELECT SGC.sys_id, TBL.semester, SGC.bonus, SGC.exam, SGC.ca FROM SubjectGradeComponent AS SGC, '; $query .='(SELECT `sys_id`, `semester` FROM ...
0
votes
0answers
7 views

Making mysqldump backup in c# doesn't retrieve data

I've got a code to create a backup copy from a query, this query takes the older registers from a year in the past and saves them into a *.sql file. But the problem that i found is when i open the ....
0
votes
1answer
16 views

Multiple IFs for different conditional selections inside a trigger

i have an issue when i try to calculate the number of rows inside my table, using a multiple separated ifs condition inside a trigger to test the field if it's different from empty. i have tried to ...
0
votes
2answers
24 views

Limit certain attribute on an SQL query

I am building a library database. I want to write a query that returns the top 5 books for each category, which means that it has to return the 5 books that are borrowed the most times for each one of ...
0
votes
3answers
35 views

One MySQL query to get nested results?

I'm working on a PHP / MySQL classified search engine where people can type some keywords and the results page should : 1) List the users who published listings matching these keywords AND 2) Below ...
0
votes
0answers
11 views

How do I export a MySQL DB to Microsoft SQL Server

I have a MySQL DB, that I would like to import into a Microsoft SQL Server. MySQL Server version: 8.0.15 - MySQL Community Server - GPL Microsoft SQL Server 11.0.5058.0 I tried exporting the MySQL ...
-1
votes
0answers
24 views

Error inserting DateTime values on database

I searched for this online and some posts even here on stackoverflow talk about this but never resolve to my problem. I am having a problem inserting DateTime into database. The first problem is that ...
-2
votes
0answers
17 views

Get starting salary and end salary from range like '10000-2000' using mysql [duplicate]

I have salary details like 10000-20000 in mysql database. Want to get starting salary ie 10000 and end salary ie 20000, to run mysql query to check whether starting salary greater than x and end ...
0
votes
0answers
7 views

Navicat SQL Consol in table, set record=itself/10

UPDATE `kingdom`.`monsterinfos` SET `PlusCps` = `PlusCps`/10 on table monsterinfos how to set all pluscps records to itself/10 on navicat console.
0
votes
0answers
5 views

Foreign key doesn't have a default value, when trying to update child row

I am trying to create information about a customer where two tables needs to have two new records of information. It works fine when I insert data into one table with a primary key but the other needs ...
0
votes
1answer
23 views

RecyclerView not updating after input

Im saving data in MySql and want to add an update function to my saved notes. Im displaying the arraylist of notes in a recyclerview. When updating i have implemented a click function on my cardview ...
0
votes
0answers
10 views

MySQL I need to automate a process of finding

I have 4 tables. one is for client info, one for seller info, one which orders are entered into, and another which has specific shipping prices from seller state(location) to client state. An order is ...
0
votes
1answer
16 views

Change Position of Existing column in Rails

I have one Column in my Table, i want to change its position from last to second, can anyone please help me to do that. thanks in Advance.i have idea about after: column_name, but its apply while ...
0
votes
0answers
7 views

pandas to_sql(): is the operation atomic or not

i want to periodically insert a pandas DataFrame into an existing mysql db in "append" mode like : df.to_sql(db, conn, if_exists='append'); is this operation atomic or not? if not, how can i make it ...
-1
votes
0answers
13 views

User registration limit and registered user confirmation not working. What do i do? [duplicate]

I am trying to limit user registration in my database and also check if user already exists in the same script. Here is what i have below, I have tried to put the code in diff ways but nothing works. ...
2
votes
0answers
19 views

How to Recovering MySQL database or table from XAMPP folder after system formatting

How can I access the database from xampp folder? I have installed a new one XAMPP. When I copy my backup folder (with the name of my database, containing all .frm and .opt files) to the D:\xampp\mysql\...
0
votes
0answers
20 views

How to link multiple rows within a single table - MySql

I'm looking into a way on how I can link multiple rows within a single table. In short, this is a system in which users can add messages. Messages are linked to a division. A user can post a message ...
0
votes
1answer
20 views

How to retrieve multiple data in one column field in db and show it each by each into input field

I want to saved a 2 input field with the same path. I want to display a data, I have two input fields with the same path. But unfortunately when i click update it shows in each field the two ...
0
votes
1answer
16 views

Exporting from MySQL and importing into Microsoft SQL

I exported a MySQL DB, both structure and data, using PHPMyAdmin, with the option of exporting it as MSSQL compatible single file: mydb.sql The resulting file is large (about 2GB). I have a DB set ...
-1
votes
0answers
34 views

How to show selected value in drop down

I have a table brand in which all brand names and IDs are saved. In my addentry table brand id is saved. In the entry detail screen I am using a drop down to show brands. I want to show all brands ...
-1
votes
0answers
12 views

ERROR JavaScript POST canvas value to MySQL and restoring to img tag

I save the canvas value to a MySQL table and when I want to restore it to view, all my imgs only show 1/10 from the full page, like this: http://prntscr.com/ns8ce0 I already tried to fix it by ...
-1
votes
1answer
43 views

How to make a select correctly in PHP?

I have the following problem: There is a gigantic query that concatenates a set of user-selectable conditions (select boxes, text fields, etc.). By default, if nothing is selected anyway (not have ...
-1
votes
1answer
53 views

Is there a query to get a resultset

I have a table 'matches' containing data something like this: team1 team2 result_team_1 result_team_2 TEAM1 TEAM2 2 9 TEAM3 TEAM4 0 0 Is there a way (query, ...
-1
votes
0answers
12 views

Store virtual keyboard values in database using php

I want to create a form in which the user inputs the data from virtual keyboard and the program will read the values from the virtual keyboard and store the values from the virtual keyboard into mysql ...
0
votes
0answers
24 views

Surprising timing stats for sql queries

I have two queries whose timing parameters I want to analyze. The first query is taking much longer than the second one while in my opinion it should be the other way round.Any Explanations? First ...
1
vote
0answers
33 views

Optimizing SQL query from derived table

I have the following SQL query select s.channel_id, count(1) as unique_views from ( select m.channel_id from view_statistics vs inner join medias m on m.id = vs.media_id group by m....
0
votes
0answers
13 views

SQL Stock Consumption Report

I have tables article_receive and article_issue along with several other tables, out of which i need to create a consumption report. In article_receive i have 2 types of transactions, A JVN(Journal ...
0
votes
1answer
9 views

Does mysql lock table for writes while adding new column with default value

If I execute below sql, will mysql lock complete table (no write can take place till the below operation completes)? in my opinion yes, as it has to modify all rows and add default values. However ...
-1
votes
0answers
30 views

MySql Database query takes much time to process data

I've more than 10 million (10 Lacs) records in my table. i want to get data using group by on one field. Table structure(users) -------------- id user_name, project_id, position, keyword (Reapeated ...
0
votes
0answers
17 views

copy data from one database to another and encrypts database data

I have query about copy data from one database to another using python 3.6.4 . i have success select and insert data in database, i want before insert it to encrypts the data using RSA or any other ...
0
votes
2answers
29 views

How to filter and order by a row that exists on the same table?

I have a simple table with 2 columns "id" and "ink_number" and I would like to create another column called "nk_exists" that will have a value of 1 or 0 depending on if there is a row like it but with ...
0
votes
2answers
38 views

Why LEFT JOIN is terribly slower than INNER JOIN?

I have two tables, toynav_product_import - 18533 rows, catalog_product_entity - 42000 rows. The below query, LEFT JOIN takes more than 2 minutes, while INNER JOIN runs in 0.009 seconds. The first ...
0
votes
2answers
14 views

Extract on history row last status

I have on MySQL database the table tableStatus with 76869 rows. These 76869 rows are the history for each element and Code node. On the history the single element and Code nodecould change his ...
0
votes
0answers
21 views

How to navigate to the correct offering site

I´m currently developing an online real estate market and am having trouble to navigate from the overview site, where all real estate offerings are displayed to the detail site. What works is that ...
0
votes
1answer
19 views

How to write mysql join sub query from 5 tables in laravel controller

I have a MySQL query like bellow, and I want to use it in laravel controller, I know how to use join in laravel, but I don't know how to write it when we have another sub query in the join statement,...
-1
votes
1answer
18 views

Connection Error while connecting the mysql database through python

I am trying to connect with Mysql server using mentioned below python code import mysql.connector mydb = mysql.connector.connect( host ="127.0.0.1", port = 5000, user ="user id", ...
0
votes
0answers
18 views

I used the query by nested and want to it in join operation

--------------------------------- emp_id | emp_name | refferal | --------------------------------- 1 | amit | - | --------------------------------- 2 | Vinay | 1 ...
-2
votes
0answers
19 views

Fast select with category name in large product table

Fast select list of products with category name in large table. I need to select a list of products from large MySQL table(~2,000,0000 rows) with its category ID and category name. What is the best ...
0
votes
2answers
15 views

Why will my Docker containers not talk to each other

I am attempting to get my node express docker container to talk with my mysqldb container. But when I query I always get: 'connect ECONNREFUSED 127.0.0.1:3306'. What am I doing wrong? Here is my ...
0
votes
2answers
20 views

How to store data of “Drop-down” list from JSP to our MySql Database?

In my application I have a dropdown list in the form, I want to take one value of that dropdown list from User and store it in the database. I am new to spring development and I do not know what is ...
0
votes
2answers
19 views

Update multiple columns with same value, short syntax

Question extracted from mysql update multiple columns with same now() Second question why this query doesn't update the columns: mysql> update table set last_update=last_monitor=now() where id=...
0
votes
3answers
39 views

How to join these tables in codeignter

I am facing problem to join these tables and also know how to make controller code to view data in view file with text boxes. public function get_order_return_info() { $this->db->select('...
0
votes
1answer
35 views

JPA + Hibernate + MySQL: How to propagate a schema into the connection?

I have several independent components in my application. Each has its own data model within a DB schema: @Entity @Table(name ="sample") // the table name is not unique among components (schemas) ...
0
votes
2answers
25 views

Could not create foreign key in Laravel migration

I am working on a project where I am using laravel 5.8. Here I want to create a foreign key. I tried lots of time but every time I got an error message on migration time. There are three tables one is ...
0
votes
0answers
7 views

mycat v1.6.7.1 run test-tool but got a error,like that “can't find main class io.mycat.performance.TestInsertPerf” [on hold]

./test_stand_insert_perf.sh check JAVA_HOME & java ---------set HOME_DIR------------ Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=64M; support was removed in 8.0 ...
0
votes
0answers
23 views

display the circle after drawing on google map

Good day everybody, i have one issue and i hope someone help me with it. I have success draw and insert the the circle into my database, when i save the circle its will be hide from google map i want ...
-1
votes
0answers
19 views

apostrophes or ampersand causing error in MySQL

When I try to enter the following data into the database, these characters create problems: & (\u0026) and ' (\u0027) { "Id":5507542,"Name":"Port \u0026 Company® - Youth 50/50 Cotton/Poly ...

http://mssss.yulina-kosm.ru