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
answer100
viewsHow to take the last sale of each customer
I have a client table: ---------------------------------------------------- codigocliente || razao || cidade || estado ---------------------------------------------------- 0001 || Sup. Mercado ||…
-
0
votes1
answer33
viewsConnect a lineEdit to a class method
am having a problem giving the following message "Typeerror: query'" I have a project that so far works well in structured paradigm, but I’m trying to rewrite the code in POO. I have the following…
-
0
votes0
answers43
viewsHow to pass String filter in a change from Mysqli to PDO in PHP?
// Mysqli $vf = mysql_query('SELECT id, cnpj, id_erp, fantasia, razao FROM usuarios WHERE nivel="3" AND ( nome LIKE "%' . limpa($_POST['termo']) . '%" OR email LIKE "%' . limpa($_POST['termo']) .…
-
0
votes1
answer34
viewsLaravel int to 32-bit binary (and vice versa)
In an attempt to create a column with binary 32-bit numbers /** * Run the migrations. * * @return void */ public function up() { Schema::create('teams', function (Blueprint $table) {…
-
0
votes1
answer41
viewsSum of Count’s from different columns
Good morning, I have a school activity in which I aim to develop the consultations sql’s for each question. The activity has 1000 megasena results, containing the columns sorteio, data_sorteio,…
-
0
votes1
answer22
viewsView in SQL ERROR
I’m trying to ride a SQL to use in the methodology view. But when executing, it produces an error. I need as a result the amount of items that are in the 'Released' condition and the amount of items…
mysqlasked 4 years ago Sr. André Baill 6,946 -
0
votes1
answer63
viewsSelect the last months, also showing the months without records
Hello. I am doing a SELECT to return the last 06 months, showing the count of records (in the example: sales), grouping by year-month. My query currently looks like this: **Schema (MySQL v5.7)**…
-
0
votes1
answer26
viewsHow do I perform more than one database query on a single request . GET on the same route on NODE.JS?
I am creating an API for a personal project, and I need to make 2 queries to the database in the same GET request. My code looks like this: module.exports = { async listarAnual(req, res, next){…
-
0
votes2
answers33
viewsHow to search multiple columns together with max() SQL (Mysql)
The problem is this, I have the tables protocolo and historico; second stores several records linked to a record of the protocol table. I wanted to fetch the last record of each historical for…
-
0
votes0
answers14
viewsError: java.sql.Sqlsyntaxerrorexception: ORA-00979: not a GROUP BY Expression Please correct SELECT statement
I am having this error after the query. $A$ is the table nickname! I need to know how many records have duplicate number, but my query is wrong and I am unable to find the error! SELECT…
-
0
votes0
answers32
viewsQuery error in SQL
I am trying to make a bank consultation for access release. When I make the following query: <?php if(isset($_POST['Login'])){ $user = $_POST['user']; $password = $_POST['pass']; $sql =…
-
0
votes1
answer42
viewsDisable mysql value checking
I have a system running on a VPS that was done by me on localhost (but on another computer). This system was made in php and connects to a mysql database in the VPS itself. Now, I am cloning…
-
0
votes1
answer30
viewsINNER JOIN with 3 sql tables
I have 3 tables in the database: tbl_cupom_generated: id_cupom | nome ------ ----- 40 João 60 Maria tbl_coupon: id | desconto | id_estabelecimento ---- -------- ------- 40 50% de desconto 1 60 20%…
-
0
votes1
answer18
viewsSQL: How to copy the value of a meta_key into an array in another meta_key?
Asking here because it seems more a matter of SQL than Wordpress. I have a Wordpress installation that uses custom fields from both the ACF plugin and the template. There are over a thousand posts…
-
0
votes1
answer32
viewssum values in subquery by field
Good morning, I’m trying to solve this but I can’t, in this select he has a field called emprestimo_id. I need to sum the remaining amount of each loan into one subquery calling for "remainder", but…
mysqlasked 3 years, 11 months ago Neoelectronics 99 -
0
votes0
answers48
viewsFlutter + Php + Mysql
Well, I’m new to flutter but basically I’m doing a simple registration with 3 fields. Summarizing my problem is that I can register normally by Androidstudio emulator, but when Gero APK and I try to…
-
0
votes1
answer28
viewsMysql - Select the most inserted records in a given period
I am needing to select all most recurring records (top 5) within a time interval but am not getting. Basically when I do this: SELECT assunto, count(*) AS total FROM tabMsgs WHERE dtCriacao >…
-
0
votes2
answers43
viewsHow to calculate the cumulative sum/subtraction of previous records in SQL?
I’m trying, unsuccessfully, to create a column SALDO in order to keep track of the Cash Flow balance. I imagined doing this in SQL itself, generating a column that would calculate the balance. For…
-
0
votes1
answer21
viewsERROR: Operand should countain 1 column(s) - CASE WHEN... THEN
I am trying to run this Mysql code to perform a company time Clusterization but is showing error 1241: Operand should contain 1 column(s) . Someone can support me? SELECT *, (case WHEN…
mysqlasked 3 years, 10 months ago Nicolas Figueiredo 19 -
0
votes0
answers13
viewsIs it possible to reference an alias in Mysql and use its field value?
I have the following situation: An electronic point in mysql and working on a query that makes several calculations with dates and times. select nome_colaborador, date_format(data_registro, "%d %M…
-
0
votes1
answer31
viewsProblems with ORDER BY in MY SQL search
Good morning guys, how are you? I have a little problem to get a more "advanced" search with my MYSQL, you can help me? I created a search as follows SELECT idproduto, descricao, vconsumidor FROM…
-
0
votes0
answers31
viewsAlign populated values by columns using case when in mysql
As I could align the values in this SQL query per column, are 2 possible questions for each question in a list of several users who answered the first and second question: question one? answer a…
-
0
votes1
answer44
viewsGroup by month (in each column) SQL
I am using the code below to make the column of the month of January, but I could not find a way to return the month of February to the side. SELECT CASE WHEN CODGRUPOPROD LIKE '20%' THEN 'TALHA…
-
0
votes0
answers36
viewsHow can I add values from a table using a date as a parameter?
I am trying to add some values of a table taking a date into consideration in sql. I want to add up the values until it reaches a date and a value greater than or equal to the initial value. An…
-
0
votes2
answers81
viewsLIMIT 1 with LEFT JOIN
Good to start I will post the SQL I rode here: SELECT a.*, b.name AS currentClubName, c.name AS transferorClubName, d.name AS contactName, d.phone AS contactPhone, d.phoneApp AS contactPhoneApp,…
-
0
votes0
answers23
viewsI cannot change the root password in mysql from the error when using the command
The moment I give the command update user set authentication_string=password('root') where user = 'root'; to exchange the root password the following error appears in mysql: ERROR 1064 (42000): You…
mysqlasked 3 years, 10 months ago Jonathan Matheus 383 -
0
votes0
answers42
viewsLoad . SQL file and run with PDO
Well I am mounting a small code in PHP 8, PDO and Mysql 8. It will be responsible for creating a bunch of data and loading the tables from a file. SQL So far I’m doing it this way: // Tenho as…
-
0
votes1
answer82
viewsapplication springboot does not connect with mysql in the Docker environment
I’m starting in the container world, and when trying to upload an application developed in Springboot with mysql integration in Docker in an aws ec2, the application does not connect to mysql.…
-
0
votes0
answers36
viewsFOR Select MYSQL Database
I need to do this same process below in Mysql; create or alter procedure SP_ATUALIZA_ESTOQUE_COMPOSICAO ( CODEMP integer, CODPRO integer, QUANT numeric(18,3), CODLOCAL integer) as declare variable…
-
0
votes0
answers24
viewsConnection to bank does not arrive in the Insert method
I’m trying to make an entry into a database mysql using Java. When running the method that creates the database connection, it works. But when making the request by Servlet, when arriving at the…
-
0
votes0
answers23
viewsAccess denied to bank with file . env
Hi, I created a file. env to store my connection variables, when I take the values of these variables on a page without connection appears all the values but when I try to access the database,…
-
0
votes0
answers16
viewsPaging with jquery event
I’m having difficulty conducting a search when I call the 2nd of the search performed. I have an input field, in which the user when entering the data is triggered an event and performs the search…
-
0
votes2
answers30
viewsGet default response if it does not exist in Laravel’s Wherein
I’m searching a series of items in a DB using Laravel through the function whereIn(). When returning, it presents a Collection with the information found, the problem happens when it does not find…
-
0
votes0
answers27
viewsOptimize Mysql query with Sub Select
I was having a problem of slowness in a select as below: select vendas.codigo, vendas.cartao_tipo, vendas.valor, vendas.datavenda, venda.autorizacao, cliente.codigo, cliente.nome, cliente.cpf,…
-
0
votes0
answers29
viewsError Code: 1242. Subquery Returns more than 1 Row (but makes no sense)
I need to know the registration number of a table grouped by method, and I also need to have the registration number of positives by positive methods, all this per user. I did something similar in…
-
0
votes0
answers33
viewsSystem using Java and Mysql Database does not recognize user and login even while in the database
I am making a Java Services Order System in Netbeans based in this course. I created the database in Mysql Workworkbench, created the user table, connected to the server in XAMP and made the…
-
0
votes0
answers17
viewsService of synchronizing images
I’m working on a project that synchronizes a folder, which contains several images (an absurd amount),. How it works ? The script sends the image data, its name and the relative path to the…
mysql filing-cabinet sql-update asynchronous updatingasked 3 years, 9 months ago William Cardoso 17 -
0
votes1
answer51
viewsSet age from date of birth in another table
I’m trying to create a Trigger to set the table age attribute funcionario: ```sql CREATE TABLE IF NOT EXISTS `funcionario`( `cpf_funcionario` INT(11) NOT NULL, `idade` SMALLINT(10) DEFAULT NULL,…
-
0
votes1
answer30
views(Python + Mysql) Enter the database password automatically in a dump
I am creating a Python script that backs up the company database I work on and it will run on crontab weekly. My doubt: How to enter the password automatically, since it is requested after the…
-
0
votes1
answer44
viewsDoubt with relation of Mysql tables
Next guys, I have these tables there, I’m studying relationship tables here... This project has no intention, except to practice and study! I linked the table Categories and types to products like 1…
-
0
votes0
answers24
viewsSave Array to Mysql using Nodejs
I have a form I’m making with Vuejs and Nodejs to the Back-End. I have a checkbox that gives me a value in Array, and wanted to save these values in the database, and when I try to save, it error…
-
0
votes0
answers19
viewsProblem when trying to insert data into pdf file by Dompdf in php mysql
I’m making a download area of records from a database using Dompdf, but as soon as I put the sql code and while to bring the database data, it gives a series of errors within a dompdf file. As soon…
-
0
votes1
answer20
viewsTrigger (Trigger) in phpmyadmin is copying multiplying records
I am a beginner and I have little experience with Mysql, but I have studied and practiced and things are going well, and I need your help because I am stuck in a situation that I can’t find a…
-
0
votes1
answer50
viewsI am making an online calendar and can not have 2 schedules scheduled on the same day and at the same time for the same professional Mysql PHP PDO
I’m making a website for a barber shop and I need to solve a little problem, in this schedule there are 3 professionals who work in the barbershop, and have the option of choosing the professional,…
-
0
votes1
answer25
viewserror with Insert and mysql
I have the following method: public byte[] CarregarArquivoImagem( Int64 idVenda,string nomeArquivo, string caminhoArquivo, int ImagemTamanhoMaximo) { string query = null; MySqlDataReader reader;…
-
0
votes0
answers14
viewsJSON.stringify returns the JSON string, but when trying to send to a MYSQL BD it escapes backslash
I am trying to register a JSON String in Mysql, I get an array with URL’s after a .map on the return of a request to upload multiple images to AWS S3, I use JSON.stringify to leave the array in…
-
0
votes0
answers22
viewsDoubt query SQL Nodejs
I have the following question in my project for a college job: I need, in a specific route, to show the user’s data, which consists basically of his personal data and the posts he has performed. The…
-
0
votes1
answer39
viewsError while running migrate
Schema::create('filiais', function (Blueprint $table) { $table->id(); $table->string('filial', 30); $table->timestamps(); }); Schema::create('produto_filiais', function (Blueprint $table) {…
-
0
votes1
answer47
viewsTurn specific rows into columns
I have a table of activity histories and would like to turn some rows (of some specific status) into columns: Current Table: The statuses I wish to turn into columns are these: mod_analise_status_id…
-
0
votes0
answers31
viewsHow to convert DATETIME to DATE using NOW function?
Can you give me a hint of how I can get around the problem below ? The goal of the Query below is to return the number of times I have received ABANDON, CONGESTION and MACHINE service status during…