Questions tagged as 'mysql'

1
answer

How to put a day, month and year placeholder in MySQL?

I need to add an invoice date column, which is organized by day month and year (dd / mm / yy). How do I leave this pre-set time format in MySQL Workbench?     
asked by 21.10.2017 / 21:46
4
answers

Add all values that are in the database and display on the screen

Could you give me a help, I have a table where I need to show the total values, in case you add all the values that are in the database and show in the table. My table calls ads and the value column calls (value). <tr> <th style="...
asked by 20.10.2017 / 19:19
1
answer

How can I not register a foreign key?

I have a database of an electronic ballot box with the following tables: Voter ( Pk titulodeeleior, name) Feedback ( Fk titulodeeleitor, vote) To my knowledge, the VotosComputados table should not insert a FK any, but one...
asked by 22.10.2017 / 03:21
1
answer

Find difference between two tables

I wanted to set up an sql statement that would return differences between two tables. For example, I have the arquivos table and the conferencias table where you have equal fields called titulo and valor , if in any...
asked by 23.09.2017 / 14:48
1
answer

"SQLSTATE [HY093]: Invalid parameter number: no parameters were bound"

I have a simple class that runs an insert in a MySql database as follows: $db = new db(); $db->exec2([0=>["Brasil","BRA","BR"]]); In class db I have the following list of queries: $arrInitDefault["queries3"] = [ 0=>...
asked by 23.09.2017 / 16:24
1
answer

Problem with subquery

Good evening, I need to bring the complete subquery result: (select (valor * 0.05) from tbl_exames) as 'Valor dos Exames', In a delimiter: delimiter // create procedure comissao(idmedico int) begin select nome_medico as 'Médico',...
asked by 26.09.2017 / 04:41
2
answers

How to list the last message of all conversations

I'm creating a chat in android studio, so I need to list the last message between the chat user and his contacts, regardless of whether he sent or received the last message. I made the select below in mysql and it works, but in sqli...
asked by 26.09.2017 / 01:59
2
answers

Fatal error: Function name must be a string [closed]

<!DOCTYPE html> <html lang="pt-br"> <head> <meta charset="utf8_general_ci"> <title> sistema de cadastro</title> <link rel="stylesheet" href="_css/estilo.css"> </...
asked by 29.09.2017 / 12:22
1
answer

JSP database connection

Hello everyone. My problem is this: I have a JSP project, which used the Oracle SQL database. However, it came in handy for me to use MySQL and I installed MySQL .jar and I changed the Connection class, all right, so much so that in the class I...
asked by 12.09.2017 / 20:41
1
answer

Picking up the last value of each ID according to the highest final year

I have the following query : select f.id_user as user, f.id_tempo, t.ano_inicial, t.ano_final from fato as f inner join tempo as t where f.id_tempo = t.id_tempo; Which returns me the following table: What should I use in query...
asked by 03.10.2017 / 15:55