Questions tagged as 'select'

1
answer

How to select columns in which years are the same in Oracle?

I have a table called Clientes , and in it I have the following columns: id_cliente nm_cliente dt_nascimento I need to select and count all clients that were born in the same year. I already tried some things, but they do not return b...
asked by 21.11.2017 / 00:37
1
answer

Update in a table with values from another

How to update the values of a table, using values taken from another table: UPDATE produto -- atualizar a tabela produto SET produto.quant = SUM(entrada.quant) -- produto.quant será igual a soma da coluna quant da tabela entrada WHERE pr...
asked by 16.03.2017 / 14:51
1
answer

SELECT Multiple Date Range in MySQL

Staff have a problem with extracting dates in a training range. What I need is the following if a training started on 01/01/2017 and its completion on 03/03/2017 elevate should return in the select below for the months 01.02 and 03. Today this s...
asked by 08.01.2017 / 23:07
2
answers

How to insert 200 new records? [closed]

I need to insert new data into one table, but there are many. I did like this: insert into pessoafisica (coluna1, coluna2, coluna 30) select (dado1 dado2 dado30) But there are many, you can not do 1 by 1. Could anyone help me?     
asked by 13.01.2016 / 15:02
1
answer

"Fine tuning" in SELECT for a ranking system

I'm having difficulty using MySQL. I've been asking here already, and I've done a lot of testing and progress in crafting a select for a ranking . I have a "player" table that holds among other infos, nome_jogador and pontuacao...
asked by 12.02.2016 / 02:16
3
answers

Search for value corresponding to weight

I have a table with values, where each value is according to weight (kg).    Up to 3kg = $ 20.00       Up to 5kg = $ 25.00       Up to 10kg = $ 28.00 SELECT estado, kg, valorCap, valorExcedCap, valorAloremCap, prazoCap FROM transporta...
asked by 14.05.2015 / 21:49
3
answers

Find information from the bank table with PHP every 10 minutes [closed]

I need to fetch information from a database table every 10 minutes using PHP language. Does anyone have any idea how I can do this?     
asked by 21.03.2015 / 16:56
1
answer

Group cells case when empty sql

I am making a query in the database to know in which branch the customer paid a portion and what the normal value and interest that was paid. The parcel value is transaction 3 in the bank and the interest amount is transaction 59. Follow t...
asked by 17.12.2018 / 19:45
1
answer

Search for similar items when using a brokerage table?

Following some advice to optimize queries in MySQL, I decided to split a list of items into 3 tables: Table animes: +----------------+-------------+ | id | titulo | +----------------+-------------+ | 1 | Anime...
asked by 17.07.2018 / 02:32
2
answers

Search in two tables [duplicate]

I have a media table with the fields id_midia , nome , tipo , and another synonymous table that has the id_midia , sinônimo I need to make a query where it checks the two tables whether the term you typed is co...
asked by 20.09.2017 / 14:23