Questions tagged as 'select'

0
answers

Select SUM within another select MYSQL

This query is already working: SELECT itens.setor, xregras.nsetor, itens.grupo, xregras.ngrupo, itens.conta, xregras.nconta, itens.dotacao, sum(IF(tipo = 'ES',total,0.00)) as efetivado, sum(IF(tipo = 'NE',total,0.00)) as...
asked by 09.10.2015 / 20:38
2
answers

Do a search for my site in two tables

I need to do a search for my site where I would first get back to businesses that have something similar to the one typed and, below, show all registered products with something similar to the typed one. I have two tables: tbl_empresas 'id'...
asked by 30.09.2015 / 14:59
0
answers

Select Advanced separated by hour

I set a SELECT to return some information from my separate table by time and date. Until that part everything is working correctly. Now I need it to select the same data only from another date, which is the same table. My SELECT...
asked by 29.07.2015 / 15:17
0
answers

Select and calculate hours with varchar datatype

Hello, by date, I need to make the longest hour minus the smallest hour of X people. 1 How do I select the largest and smallest by a date? I've tried a lot, I can post here the attempts. 2 The data is written as varchar, how do you find th...
asked by 11.06.2015 / 15:31
3
answers

Error selecting select text

Good evening, everyone. I have a select that lists the cities of the respective state. I'm using this code to select a city from the list: $('#txtCidades option').removeAttr('selected').filter("[text=São Lourenço da Mata]").attr('selected', "s...
asked by 19.03.2015 / 23:25
2
answers

How to get the sub node from a select list

I have a responsive menu on my site that some options should not appear when viewed through the phone. <ul class="sf-menu"> <li><a href="#lk1">A gente!</a> <ul>...
asked by 26.03.2015 / 02:05
1
answer

SELECT with JOIN return an Object with Internal List

I would like to know if it is possible to do a select with join where the second table table will return more than one row and in that create an object with an inner list. To get clearer, see the example: Tabela Usuario: idUsuario, nome, cpf T...
asked by 06.11.2014 / 22:05
1
answer

Select Format yyyy-MM-dd HH: mm: ss in MYSQL table column

Date 2014-12-01 10:52:38 2014-12-01 10:52:14 2014-12-01 10:51:57 2014-12-01 10:35:34 2014-12-01 10:23:17 2014-12-01 10:22:18 2014-12-01 09:03:49 2014-12-01 08:53:51 I have this column with these dates and I need to do a select that filters...
asked by 26.01.2015 / 17:30
1
answer

List the owner of the post and the last user who commented. Mysql

Hey guys, I have the following query below, where I list all posts, number of comments and the user who created it, but also wanted to list the last user who commented on each post, can you do all this in just a query? SELECT post.titulo, COUN...
asked by 05.02.2017 / 15:07
2
answers

Search ID in a select in PHP

<select class="form-control" name="cliente"> <?php if ($clientes) { foreach($clientes as $ind => $valor) { ?> <option value="<?php echo $valor->nome ?>"><?php echo $valor->nome ?><...
asked by 18.09.2017 / 19:16