Questions tagged as 'mysql'

1
answer

Optimize MySql search

Hello, I have a query that I can not optimize. Records: 1,904,447 records Name: table_mae Related to Records: 10,748,360 records Name: table_filho -- index criado para id_tabela_mae -- index criado para data SELECT tabela_mae.nome...
asked by 10.06.2015 / 02:26
1
answer

Questions about Stored Function

What is a Stored Function, what is its basic syntax? How and where to use a Stored Function     
asked by 24.09.2017 / 00:54
1
answer

What is more efficient, a complex query or treat the results?

I can do this: $sql = 'SELECT * FROM ' . 'data_companies ' . 'INNER JOIN data_companies_extra_infos ON' . 'data_companies.cod = data_companies_extra_infos.relationship'; $rs =...
asked by 20.10.2017 / 18:38
1
answer

Error inserting PHP MySql data using the Android volley lib

I'm developing an application that will have to send data to a server. My php source code is this: connection.php <?php $mysql_hostname = "localhost"; $mysql_user = "root"; $mysql_password = ""; $mysql_database = "ap...
asked by 30.10.2015 / 20:55
2
answers

How to count number of records in a table?

I have a table called noticias , where every news item has id . I also have a table named comentarios , where there is id of the news that the user commented on. How can I tell the comments for that news?     
asked by 25.07.2015 / 23:08
1
answer

Count in IReport

I have a report where I have the Status column, in this column I have the following statuses: Finished and Pending. I created a variable and added it to the Sumary band and set the following properties: Variable class = java.l...
asked by 06.08.2015 / 15:52
1
answer

How to avoid duplication of content in a table without a primary key?

In a virtual store panel that I am building the products have relationships by color and size, where each product color has a size. This is a part of my database for a better understanding of the problem: link When the user wants to associate...
asked by 20.05.2015 / 16:44
1
answer

SQL return on different columns, not on rows

I am testing a query, where I would need the returns to come in distinct columns, but in the form below it returns in rows. I tried to use LEFT JOIN but the syntax did not work. select u.nome_completo AS NOME1 from usuarios u where u.cr...
asked by 27.04.2016 / 15:11
1
answer

DOUBT Overuse of SELECT and Standard Tables

I have a question about the advantages of having standard tables and how to use them within a SELECT. Let's suppose the following tables: -------------- | tb_endereco | -------------- | id | | rua | | numero | | ba...
asked by 13.12.2017 / 07:09
1
answer

Is there any risk in using "SET FOREIGN_KEY_CHECKS = 0"?

According to what I read somewhere, FOREIGN_KEY_CHECKS :    ... Specifies whether or not to check foreign key constraints for InnoDB tables. That is, if the guy wants to disable the foreign keys check, it does: SET FOREIGN_KEY_CHE...
asked by 17.11.2017 / 16:05