Questions tagged as 'mysql'

1
answer

Reorder position in a sequence via MySQL

I have a table of Chamados . I have to add an entire column that will be called sequencia and it will be used to search the order that the user wants. Just to illustrate: the call will have arrows, when you click the arrow pointi...
asked by 05.09.2014 / 16:07
3
answers

Form submission settings

I'm not sure what to do, but I'm not sure how to do this. "textarea". so after much trying, I decided to delete everything from mysql and the root of the cpanel. Please, whoever can help, thank you very much. "I need to step-by-step which files...
asked by 17.07.2018 / 11:28
1
answer

List getResults returns list with elements equal

Hello. I have the following table in mysql: create table resultado( data varchar(10), premio varchar(3), loteria varchar(5), milhar varchar(10), primary key(data, premio, loteria) ); The class representing this table in Java: public cl...
asked by 22.10.2018 / 04:28
1
answer

How do I not repeat RAND () results in php?

I need to create a simulation that will do a SELECT of 5 questions at random. I'm using ORDER BY RAND() , but the results repeat, and I do not know how I can fix it. I even created a vector that stores the code for each question, but...
asked by 25.10.2018 / 06:16
1
answer

How to retrieve data from a SUM with where different?

I have a working time table, which has the data_inicio , data_fim , usuario_id and extra that indicates whether it is overtime or not. I already have a query that brings the sum in seconds worked per year, month, use...
asked by 07.05.2018 / 22:54
1
answer

How to use time_format () in MySQL?

I made a table like this: create table tabela ( hora time not null ); This table returns me hour, minute, and second. How does the table with time_format ()? I want to leave you alone with the hour and the second. My question is in the synta...
asked by 02.05.2018 / 16:17
1
answer

Query 2 SQL tables bring all results

I am doing a SQL query to bring users, but I consult 2 tables: users and users_vip No users have all users and users_vip only those that are vip (active or not). When I make my query joining the 2 tables it only brings who has a registrati...
asked by 03.05.2018 / 15:04
2
answers

Catch only the year of a column in MySQL

I have a query that has a condition, which checks whether the record is greater than or equal to today's date. It looks like this: WHERE t1.bidpack_buy_date => NOW() Well, it will check if the value of the bidpack_buy_date colu...
asked by 10.04.2018 / 19:17
1
answer

Problem in SQL selection

Because even if I filter to return only the fiat manufacturer, does it return other values? SELECT FABRICANTE, MODELO, VALOR_DIARIA FROM VEICULO WHERE VALOR_DIARIA = (SELECT MIN(VALOR_DIARIA) FROM VEICULO WHERE FABRICANTE = 'FIAT') Re...
asked by 07.04.2018 / 01:49
2
answers

Insert array into a database using PHP

In the site I'm creating I have a form where people can add multiple topics. My problem is when a second or more topics are created because only the first one goes to the bank and I can not get the others inserted. The code I'm doing is this...
asked by 09.06.2018 / 20:48