Questions tagged as 'select'

1
answer

Select the most recent record of a given table - PostgreSQL

I need to select the most recent record of my Estoque if the data column is different, I was able to bring the oldest one when the dates are different: SELECT codigosuprimento, numeroserie, max(data) FROM public.estoque where usa...
asked by 31.10.2017 / 12:33
3
answers

SQL to search across the database

Is there any command to do a select on all tables in a mysql database? Type I have multiple tables in my database with miscellaneous content. I need a way for a user to search for a keyword in all tables.     
asked by 10.08.2017 / 19:29
1
answer

Query is returning an empty array (MySQL / Wordpress)

How do I get the values from the meta_value = candidate field of this table. I'musingthisquery,butit'sreturninganemptyarray.$resultados2=$wpdb->get_results("SELECT * FROM $wpdb->usermeta WHERE $wpdb->usermeta.meta_key...
asked by 10.02.2017 / 13:39
2
answers

How to make a datagridview C # sort a list (IList) with click on the grid header? [closed]

How to make a DataGridView C # sort a list (IList) with click on the grid header? For example, I have a list with three fields (id, name, city), when the user clicks on the name column, I want to sort by Name, if I click on the city I want...
asked by 02.01.2017 / 20:49
2
answers

Firebird Query Select using same field twice

I have a field called patient_id, I want to create a select + - so select count(paciente_id where = 0), count(paciente_id where <> 0) from agenda I do not know, but I want to know the amount of items where patient_id is equal to zero...
asked by 06.10.2016 / 22:56
2
answers

How Select SUM works (IF ('' , '', ''))

I'm just having a question about how select mysql works. Select SUM(IF('','','')) I'm using it but I do not know exactly how it works     
asked by 02.06.2016 / 15:19
3
answers

Get a single record for equal columns

I have an example table: produto | supermercado ---------------------------- 1 | 1 4 | 2 6 | 1 5 | 1 8 | 2 7 | 3 I want to get all the exis...
asked by 11.05.2016 / 19:16
2
answers

How to query data from a table using INNER JOIN in a subquery in PHP

I have the following SELECT to select data from a table ( chat ) on a chat system: SELECT * FROM (SELECT * FROM chat WHERE id_chat = '$chat_id' ORDER BY id DESC LIMIT 10) S WHERE id_chat = '$chat_id' ORDER BY id ASC LIMIT 10 Th...
asked by 12.01.2016 / 00:49
1
answer

Select with Join, in Codeigniter

I'm having a doubt on a select with the use of join in codeigniter, it follows: I have 2 tables. tabela jogo id | id_time1 | id_time2 99 | 1 | 2 tabela time id | time 1 | Real 2 | Barcelona I want to return teams to set up a...
asked by 22.01.2016 / 02:35
2
answers

How to do a select within another select in mysql

I need to get the smallest value of a column to use as a condition in where , but I do not know how to do that. The column I need is ordering , as below: SELECT p.pro_name, p.id, f.image as foto FROM #__osrs_properties p LEFT JOIN...
asked by 08.11.2018 / 17:35