Questions tagged as 'query'

3
answers

Do not fill field if it does not exist

I have a question about how to ask a question to the database. Suppose I have two tables with slightly different structures Table1 id tipoA data 0 A '21/12/14' Table2 id tipoB data 1 B...
asked by 16.06.2015 / 16:26
2
answers

Consultation with Eloquent do Laravel

I have this query: select Q.id,Q.questao, D.disciplina, S.serie, S.ensino from questoes as Q left join capitulos_questoes as CQ on CQ.questoes_id = Q.id left join modulos_questoes as MQ on MQ.questoes_id = Q.id left join banco_discip...
asked by 10.10.2016 / 19:38
2
answers

Navigate query records with PHP PDO

I have always worked with ASP connections using ADODB and navigating the logs that the query returned to me was not a problem since they were: <% rs.movenext //anda para proxima linha do retorno da query rs.moveprevious //anda para linha an...
asked by 16.04.2015 / 15:21
4
answers

The WHERE clause order interferes with performance?

Recently I did tests on a database with a query using two clauses where AND. I noticed that there was a significant difference using clause A before B and vice versa. Intuitively, it would be faster to use FIRST the more restrictive criterion...
asked by 22.12.2014 / 19:01
2
answers

How to do in a select html, when clicking select more than one row at a time?

I have a query that brings me the first 3 letters of the name of a month with the last two digits of the year for example: JAN.16 in my combobox it brings me months independent for example: JAN.16 FEV.16 ... and on and on. I wanted the combob...
asked by 08.06.2016 / 17:39
5
answers

How to check if a text or ntext field is null or empty?

How can I check if a field of type ntext is null or empty in where ? I have the following select SELECT Subject, Notes from DocumentNotes where Notes is null or Notes = ' ' but when compared it returns the following error...
asked by 19.11.2015 / 15:08
5
answers

How to reduce the search time in a table with more than 200 thousand records?

I'm having problems with listing and searching table data with more than 200,000 records. I read in searches, that for the search system, the ideal would be to do indexes of the type "fulltext" in the fields where it will be will have a searc...
asked by 31.08.2017 / 08:59
2
answers

Optimize Mysql tables

I work with some huge tables in a system I've developed. These tables are constantly being updated and sometimes the query becomes slow. Some of them have more than 100,000 lines. I would like to know how often I should run the optimization c...
asked by 20.02.2014 / 17:08
2
answers

Select with expression "other than" with two conditions

I would like to know if there is any way to make a select using a where for a field with a parameter other than < > , with two or more items. To facilitate following example: select * from TAB_DESPESAS where cd_ite...
asked by 31.07.2017 / 22:58
2
answers

How to put 2 select in mysql

I have 2 select which are basically identical, changing only 1 table. I'm trying to put the 2 in a single select, but I'm not getting it. Follow the select: SELECT DISTINCT a.id, a.unidade, a.posicao,...
asked by 03.02.2017 / 17:37