Questions tagged as 'mysql'

1
answer

Improve the performance of a query

How could I improve this query, which returns me the top 10 sales to assemble a chart, so that it processes faster? set @startDate :='2015-01-03'; set @endDate :='2015-05-31'; set @dst_id:=1; SELECT SUM(vnd_quantidade) as quantidade, (S...
asked by 29.06.2015 / 14:25
1
answer

Write the result of a variable in the mysql database using python passed as parameter

I have a database in mysql that contains a table with multiple expressions. I can extract the expressions through procedure , solve them, but when I want to return the calculation value to the bank with another procedure , thi...
asked by 26.06.2015 / 04:43
2
answers

SQL - UPDATE double with double where

Next, is it possible to do two update-where together in the same query? I'll explain, what I wanted to do is this: UPDATE usuarios SET nome = "Matheus Silva" WHERE id = 1 AND UPDATE usuarios SET nome = "Lucas Silva" WHERE id = 2...
asked by 18.01.2016 / 05:06
3
answers

Creating a database for each user

I am setting up a web sales system with php and mysql , where we will have several companies registered, each company being a user that will control their sales. Our team has a question: create a banco de dados for each user,...
asked by 11.12.2015 / 02:52
3
answers

How to perform change in order sequence with SQL statement

I have a form where I display for the user some phases that a particular contract needs to respect, follow the image of said form: Ihavealreadydonetheupdatethatmakestheorderchangeandisworking,myquestionisthefollowing,followingtheexampleofthe...
asked by 14.03.2016 / 18:49
2
answers

Search system - Select within another

Hello, I'm doing a search engine, but I'm kind of a layperson about Querys. The method that I thought to refine the search, which in the case would be a simple search between two fields of a table with several products, was to be eliminated thro...
asked by 08.05.2014 / 22:07
2
answers

Count the weeks between two dates

I'm trying to perform a query between two dates that returns me the number of the week and counts progressively the week. As an example: Itlookslikethis:SELECTROUND((DATEDIFF(max(atendido_em_data),min(atendido_em_data)))/7)assemana,min(at...
asked by 18.05.2018 / 22:10
3
answers

No select error using mysqli_query

I've done a php to list the rooms, but I'm having difficulty listing them, if anyone can help me, I would appreciate it. <?php $link = mysqli_connect("localhost","root","","hotel"); $result = mysqli_query("SELECT descricao FROM quartos WHER...
asked by 08.06.2015 / 21:53
3
answers

Convert data in the format dd / mm / yyyy to yyyy-mm-dd

I'm getting two post in php from two dates in the format dd / mm / yyyy however to display the precise data convert from dd / mm / yyyy to yyyy-mm-dd Code: if(isset($_POST)) // Se existir o array post, pq ele não retorna undefined inde...
asked by 16.04.2015 / 20:46
2
answers

Why is this ResultSet returning null?

If I run a query in the database returns result, however, when I run the code in java, assigning the result to a ResultSet, it appears to be empty. Can you help me? PreparedStatement ps = conectar.con.prepareStatement("select colaborador.codig...
asked by 12.07.2015 / 19:17