Questions tagged as 'select'

2
answers

SUM in SELECT with LEFT JOIN being multiplied together

I have 3 tables in MYSQL. Account: id nome 1 caio 2 zé 3 marcelo Followers (the account id, that is, the user has 2 followers): idqual 1 1 2 2 2 3 Products (the account id, that is, the user caio has 3 products): idqual 1...
asked by 21.09.2015 / 21:27
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
3
answers

Hide / edit the appearance of select

I'm cracking my head to try to get the select from my site to agree with my css. In fact, only in Mozilla that the saying whose does not look the desired. I was looking for some jQuery to do editing these elements, but the problem is that on...
asked by 26.08.2014 / 14:56
1
answer

Bring only one product per branch on the sql server [duplicate]

Good morning I need to bring only one product per branch, however in my table I have several times the same product just changing the date, I would like to get the product from the last date. What I have: SELECT ID, CODFIL, DT, COLUNAVARI...
asked by 06.06.2018 / 15:15
3
answers

Select with last record

I need to value the inventory of the company in which I work and for this I will get the last value of the items. I was using MAX , but I realized that if I did this, it would return me the highest price and not the last one registered in...
asked by 04.01.2017 / 15:00
1
answer

Correct syntax for SELECT and INNER JOIN in Zend

I think it's a simple question, but because I do not know 50% of Zend I'm breaking my head, so here it goes: $sql = $db->select() ->distinct() ->from(array('cli' => 'fc_cblcli'),array('codigo','tipo','nome')) ->join...
asked by 19.11.2014 / 20:38
1
answer

Retrieve last row inserted into table with non sequential primary key - MySql

Is it possible to know which last row was inserted into a MySql table where the primary key is not sequential? I have a table where the primary key is made up of two columns that are FK, so they do not follow a sequence. When executed the...
asked by 23.08.2016 / 16:08
2
answers

Help with select and repeated records

I have a postgresql database with a table like this: id_usuario | dt_atualizacao | atualizacao | outros_dados 123 | 01-01-2001 | 0 | abc 123 | 01-01-2005 | 1 | abe 123 | 01-01-2012 | 1...
asked by 28.08.2018 / 18:50
3
answers

Problem in the order of select

I fed this chart ButIhaveaprobleminselectingit<?php$sql_2_vis=mysqli_query($config,"SELECT data, uniques, pageviews FROM tb_visitas ORDER BY id DESC LIMIT 7") or die(mysqli_error($config)); if(@mysqli_num_rows($sql_2_vis) <= '0'){...
asked by 11.05.2018 / 14:02
3
answers

Get the value of select

My Select looks like this: <select class="input-medium ajuste" id="sel_mes"> <option value="09/03/2014">Março - 2014</option> <option value="09/04/2014">Abril - 2014</option> <option value="09/05/2014">...
asked by 09.03.2015 / 21:39