Questions tagged as 'sql-select'

2
answers

Selection top 3 where distinct

Good afternoon guys. link I need a help, I tried to see in the session above but I could not solve my problem. My problem is as follows, I need to make a selection of products and all of them separated by vendor, for example. Imagi...
asked by 02.10.2018 / 22:21
0
answers

How to put the photos items inside the XML using PHP and MYSQL

I am creating an XML generator that is working right, but I have reached the point where I have to insert the photos in xml and I do not know how to do it. The "photos" tag should look like this: <Fotos> <Foto> <URLArquivo...
asked by 26.09.2018 / 20:37
0
answers

MySql hangs when trying to query table with many records (PHP)

I'm trying to make a filter where the query is done in a table where the id of the last record is in the number 468.466 . In the filter, I need to compare with a View, which has its last record id 5,303,345 . The query is as follows: S...
asked by 27.08.2018 / 14:13
2
answers

How do I get the last values entered from two tables, and sorts them by the last access?

I need to create a select that takes the id's from two tables, unite them and show me the last record of the two together. I tried this way: SELECT DISTINCT p.cod_mobilibus, p.nome, q.dt_acesso FROM pr_pontos p RIGHT JOIN pr_qr_pontos q ON p.c...
asked by 23.07.2018 / 23:02
0
answers

Creation of slow materialized view

Good evening. I'm creating a materialized view based on a JOIN with 3 tables, but it's taking too long ( 200+ minutes on the machine ). I use the appropriate indexed keys in the WHERE of each table and have already given R...
asked by 29.06.2018 / 23:49
0
answers

Query sql with reserved word in column name [duplicate]

     This question already has an answer here:                   A MySQL query with 'ciphers' vs without                                      2 answers                                                 Mysql reserved keywords        ...
asked by 22.06.2018 / 22:07
1
answer

Error in select search

I'm not able to return the value inside my arry always returns 0 Read public class Read { public ArrayList<RespostasAguaCasa> getLista() { SQLiteDatabase db = Maindb.getInstancia().getReadableDatabase();...
asked by 18.06.2018 / 16:20
0
answers

How could better performance of a SELECT with several INNER JOIN

I have SELECT with several INNER JOIN and some functions like replace , if .. This SELECT gets all the info I need, but it takes a long time. Is there any way to optimize this SELECT ? SELECT as_as...
asked by 06.06.2018 / 22:33
0
answers

How to align the result of Select

I'm working on a report, where I get the name of a person, and on what days it works. I was able to do this select, but I need the result to look like this: [JOÃO - SEG/QUART] [MARIA - TERÇ/QUINT] [JOSÉ - SEG/TER/QUART] I've used (xmlagg)...
asked by 04.06.2018 / 20:35
0
answers

Select with case inside (date)

Well, I have a problem with my select. I need this select to count how many estadoVisu has, but if the date is nula inside the case it should have a subquery inside checking if estadoVisu is VisualizadoTec2 or Visu...
asked by 31.05.2018 / 06:40