Most voted "mysql" questions
Mysql is a relational database management system (RDBMS) that functions as a server, and provides access to multiple users simultaneously. Your source code is available under the GNU General Public License.
Learn more…10,264 questions
Sort by count of
-
0
votes1
answer147
viewsRecursive query in Postgresql to create a menu tree
How to create a json from a hierarchical SQL structure with Postgresql 12? I need to create a menu as the image below. This menu is already working, but, the solution I am using is not very…
mysqlasked 4 years, 6 months ago Isaque Neves 1 -
0
votes0
answers110
viewsPersist child objects with parent id 1:N
Guys I’m having difficulty in relationships with Hibernate, I have a 1:N relationship between Provider and Address (1 provider may have N addresses). My problem is this, when I try to persist a…
-
0
votes0
answers44
viewsDelay when generating txt file and downloading using php
The problem is the following: The application makes a query in the database like size, color, price, etc... This will be placed in the txt file for later use inside the stock collector. The problem…
-
0
votes1
answer37
viewsSeparate MYSQL results by specific field for email triggering
I’m making an availability notification system (let me know) but I’m having difficulties in logic to make the iteration on LOOP grouping the results by "email" to trigger separately. CONSULTATION…
-
0
votes1
answer220
viewsMysql LIKE condition in PHP PDO
I was used to using the condition LIKE passing the parameter in connection with the MySQL and PHP via MySQLi, and I started using PDO and no result is selected when passing the value to the…
-
0
votes1
answer47
viewstable with calculated field
Existing table CREATE TABLE `dataleitura` ( `idLeitura` INT(6) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT, `DataLeitura` DATE NULL DEFAULT NULL, PRIMARY KEY (`idLeitura`) )…
mysqlasked 4 years, 6 months ago Salomao Coelho 1 -
0
votes1
answer29
viewsit is possible to join one or more columns that have the same id in mysql
I have a customer table, a employees table, products, a sales table and a table to link sales with products. my doubt is when do I select SELECT idvendas,data_da_venda,valortotal,clientes.Nome as…
-
0
votes1
answer57
viewsFunction fill menu dynamically
I have a result that comes after a query in the database. With this result I make the menu dynamically, when the user has permission to view the page. What I would like to know is if you have the…
-
0
votes1
answer297
viewsError 1064 mysql in UPDATE function
Guys I’m having a problem with the command on UPDATE, I’m using Python 3.8.5 and mysql 5.7.31. value_id = 10 value_column = 'nome' ID = 'rodrigo' comando_sql = "UPDATE user SET %s='%s' WHERE id=%s"…
-
0
votes2
answers387
viewsError trying to create table in mysql - Multiple Primary key defined
I’m creating a database and one of the tables doesn’t want to be created with prayer. The following error appears: Error Code: 1068. Multiple Primary key defined What’s wrong with my code? CREATE…
mysqlasked 4 years, 5 months ago Felipe Alves 11 -
0
votes1
answer50
viewsAdd a column where its values are already the result of another sum
I have 2 tables in a database, one contains the purchase orders, another contains the items of these purchase orders, this data is obtained from an import from another system so I do not have…
-
0
votes0
answers25
viewsQueryset to select maximum values per group - using mysql
I am trying to select the highest values per group and I would like to receive all attributes from my table, tried this solution: dropWorst1 =…
-
0
votes0
answers63
viewsDecimal is not accepting decimals - ASP.NET MVC 5
I am doing a project in ASP.NET, but it started to give a problem, the field only accepts to receive integers, every time I put a decimal number, for example 20.10, it simply does not let me insert…
-
0
votes0
answers37
viewsI need to Associate two entities in @Manytomany with JPA using Mysql, but it is not saved in the composite table (usuario_item)
I need to make the connection between user and item for a login system I’m stagnant in this error 2 days ago. I searched for forums and tutorials and could not get anything to help me. If possible…
-
0
votes1
answer351
viewspass the value of a python variable to a mysql search
I’m on a quest and I still can’t solve it. Here’s the thing: def main(): chave = [valores_lidos] while(chave!=-1): vetor = valores_lidos chave= int(input("Informe o numero de id da vaca para buscar…
-
0
votes1
answer44
viewsDoubts about if clause
I have a problem in the query below: THERE ARE SOME DATA THAT ARE ON D1_NFORI, THAT MISSING "0" THE LEFT WOULD NEED TO INCLUDE THE ZEROS TO COMPARE IN THE WHERE EXAMPLE: Where IF D1_NFORI NOT LIKE…
-
0
votes1
answer103
viewsimport a txt file into mysql
need a little help, someone knows how to import a txt file into mysql in such a way IP: data city: data state: data Latitude: data Longitude: data IP: data city: data state: data Latitude: data…
-
0
votes0
answers19
viewsControl auto increment column logging in scalable applications in MYSQL
I’m putting together a scalable queue control app (e.g., queues for snack bars or benches). Passwords are formed following the standard Acronym + number. On the same day there cannot be a password…
-
0
votes1
answer20
viewsI need to create a sequence of equal numbers within two columns in the bank
Hello guys I’m new with mysql code manipulation, I need to help to create a numerical sequence in the registration and registration columns, note: the records have to be equal in both columns! Note:…
-
0
votes1
answer94
viewsFullcalendar Uncaught Syntaxerror: Invalid or Unexpected token in description when skipping line
I’m using this calendar as a basis https://github.com/GabrielpBiu/calendario-de-eventos-php-fullcalendar-mysql In the description there is a textarea. When you jump line and save to the database,…
-
0
votes0
answers24
viewsHow do I make a select that returns a field from a table through another table?
Here’s the thing, I want to select in the model table that shows, in addition to the fields shown in SELECT, the field lamina_tubo_primaria.DESC_PRIMARIA also. But the countryside DESC_PRIMARIA only…
-
0
votes1
answer54
viewsEntity Framework trying to insert duplicate record
I am starting an application in Blazor, using Entity Framework and Mysql database. Below I will detail the Tables, Models, Context and Method that is presenting me problem: Tables:…
-
0
votes1
answer66
viewsHow to make an Insert in the database from a many to many relationship in typeorm
I am developing a professional register where each professional can speak one or more languages, however when saving professionals, languages are not saved @Entity('idioma') export class Idioma {…
-
0
votes0
answers10
views"System.Indexoutofrangeexception" in my project c#
In my financial software project I am trying to select in the database and have as a result the moves to be accounted for the balance, in my program I can already addlas in the database and all the…
-
0
votes0
answers35
viewsMYSQL change float field to decimal
My queries using PHP PDO in Mysql FLOAT fields do not find results with cents. It seems to me that PHP PDO always sends the value of the variable as a string. Even with the variable typed in float.…
-
0
votes1
answer43
viewsIs it possible to use the return of a query with GROUP_CONCAT in the WHERE clause?
I need to make a query that looks for the type of visibility that the user has, and then search for all the other users that he "sees". The user can see all the users of the company, himself and one…
-
0
votes0
answers71
viewscom.mysql.jdbc.exceptions.jdbc4.Mysqlnontransientconnectionexception: No Operations allowed after Connection closed
On my hosting service, whenever the time_out server arrives in 8 hours, gives this error: com.mysql.jdbc.exceptions.jdbc4.Mysqlnontransientconnectionexception: No Operations allowed after Connection…
-
0
votes1
answer105
views"Random" number being generated along with md5 hash
I am developing an application in Laravel and at a certain moment I need to generate a value in MD5 to assign to a field in the database. The problem is that when generating this hash of MD5, a…
-
0
votes0
answers37
viewsHow to use group by to group similar results for the same table record?
I have a database with the tables: contract, broker, buyer, seller, product and harvest. In this relationship, a contract will have only 1 relationship with the tables product and harvest, 1 or more…
-
0
votes1
answer30
viewsResult for a Mysql query
I have this query in Mysql: SELECT usuarios.modalidade, produtos.idproduto, produtos.nome, produtos.referencia, produtos.ean, produtos.valorvenda, produtos.quantidadeprodutos.minimo,…
-
0
votes1
answer19
viewsDetermining the top-20 in a given year from a last.fm scrobbles table
Good afternoon! I created a table in a Mariadb test base (XAMPP) to store all my scrobbles (times I listened to some music) from the site Last.FM. I used that tool to generate the CSV and imported…
-
0
votes2
answers85
viewsSelect to create balance based on previous month’s value
I have the following situation. I have a Mysql database where one of the columns (liquido_dia) brings the daily value generated (positive or negative), I’m already mounting a demonstrative per month…
-
0
votes1
answer71
viewsReact-Hooks/exhaustive-deps | Error in an assync function when taking data from an API
Hello, I’m having an error in React.Js that I don’t understand in trying to consume data from an API I created myself. I created a loop so that I could get the json information and print my site.…
-
0
votes0
answers83
viewsMysql file export error "ERROR 1(HY000): Can’t create/write to file"
Hello, I was having some problems to export a table in csv format from my database in Mysql due to the definitions of "secure_file_priv"... I made the following changes: I created a directory at the…
-
0
votes1
answer30
viewsCan I not use a Trigger correctly in MYSQL?
delimiter // CREATE TRIGGER inventory_update_purchases AFTER INSERT ON purchases FOR EACH ROW BEGIN UPDATE products SET products.inventory = products.inventory + NEW.inventory_bought WHERE…
-
0
votes0
answers47
viewsCreate a Java ID search with Mysql
Hello, I am creating a simple sales system. I am developing a DAO class to work with the products. I did the methods of the bank, but when I go to the methods of listing, a following question…
-
0
votes1
answer42
viewsReact - Form taken from PHP giving error "CANNOT POST"
Hello, I’m having a problem reusing a form that I used to use in my html application so that I sent the data to a PHP file to insert into my MYSQL database. Unfortunately I am not able to take…
-
0
votes0
answers142
viewsRelationship error between tables with Sequelize: Unknown column
I am creating a stock management system where a model has category one for many, doing the insertion correctly, but at the time of listing it returns me the error: SELECT `luminarias`.`id`,…
-
0
votes1
answer69
viewsView SQL database data in a similar way to the Access database
Good afternoon gentlemen I am a layman in the subject of SQL database and I am trying to visualize the data of an SQL database in table form, below is the name database E3 already created being…
-
0
votes2
answers74
viewsMysql - Catch minor record in a 1:N ratio
Good evening, I may have this answer somewhere but I spent all day researching, using various examples and nothing. I have 2 tables, one of products and another with the models being that 1 product…
-
0
votes1
answer29
viewsLavravel cannot find the file to download
I have a routine in the project where I attach documents but I can not in any way that Storage find the same. This is my download method: public function download($id) { $anexo =…
-
0
votes1
answer145
viewsSimple quotes breaking the UPDATE query in mysql
I have the following difficulty, in my application, when executing the registration function, when I type some text with enclosed quotes, the query does not work. Follow the code below: Here I take…
-
0
votes0
answers40
viewsIn my Java web project the mysql driver does not work when using the dependency in the pom.xml file
All right, here’s the deal. I am doing a java web project and when I add mysql-Connector-java as dependency within the pom.xml folder, the project does not communicate with the database. However,…
-
0
votes0
answers28
viewsSelect with field of the same name between two tables without connection however approximate values
I have the 3 tables, 'users_teste', 'nps' and 'product', the product table has no relation with the other 2 tables, I need to perform a search comparing the request of the table 'nps' with the…
-
0
votes1
answer58
viewsCompare if the value of a variable is the same as the value already saved in the database
Using Java Script, Nodejs, Adonisframework, Mysql, Lucid ORM I need to check compare if the value sent by the client through the API is the same present in my database. I need to check if the…
-
0
votes0
answers24
viewsError in an MVC application using foreign key with Mysql
I cannot register an owner who depends on a foreign key Cidadeid Mysqlexception: Cannot add or update a Child Row: a Foreign key Constraint fails (veterinario.proprietario, CONSTRAINT…
-
0
votes0
answers19
viewsSpecific filtering with Mysql
Hello, my friends. I have a mysql database, and I’m making some appointments I want to know how I can do a very specific filtering. For example, I have a database:…
-
0
votes0
answers17
viewsProblems with Chartjs
Hello, good morning!!! I’m creating a graph that pulls data from a database and shows it on the screen, with php, mysql, ajax, Chartjs and jQuery. When I use only one dataset, everything works fine,…
-
0
votes0
answers264
viewsDeclare variables in a Trigger in mysql
I am creating a Trigger in mysql with use of variables and this returning me an error and as I am starting to use mysql now I could not solve the problem, follows the error: Executing: DROP TRIGGER…
-
0
votes2
answers50
viewsnumber loop, removing some that has already been used
Good morning, I’m having trouble solving a code here I have the following table in the database The field "total" is the total number that the raffle has The field "paid" are the numbers that have…