Questions tagged as 'sql-select'

1
answer

Questions about column formatting in the gridView

Hi, I have some questions about formatting columns in a gridview, I have a gridview that populated by data coming from a table in the database, the columns and row are automatically generated, I have a method that performs the query in the gridvi...
asked by 15.06.2014 / 22:14
1
answer

Changing value of a field in a select

Query: select id_cliente,nm_cliente,tp_sexo from tb_clientes; In my bank, sex is registered as int would like when I make a select displayed Male or Female instead of 1 or 2 , how do I do it?     
asked by 22.11.2015 / 01:40
1
answer

Replication of database query with multiple FIND_IN_SET ()

I have the following query to find topics related by a set of ID's that are not the topic to be viewed: SELECT press.image, press_i18n.title, press_i18n.slug FROM press INNER JOIN press_i18n ON ( press.press_id = press_i18n.pre...
asked by 03.07.2014 / 03:16
2
answers

How to add 3 columns of different tables

I am developing a financial system. Today we have the following situation: Banks (id, name, initial balance); Recipes (id, geraParcela, qtdeParcelas) Recipes_parcels (id, recipe_id, value, date_wind) Expenses (id, generatesParcela, qtd...
asked by 22.04.2014 / 23:29
1
answer

Calculating SQL hours

I need to implement a working hours report within a period. My difficulty is this: the records for each day are on different lines and because of this, I'm having a hard time knocking in and out of the right days and I still have to subtract...
asked by 14.09.2018 / 23:22
1
answer

SQL Server rotary records

I would like to know how to select routing records from a table. For example I have a table called disclosure and I want the records to be selected in such a way that today swallows the element x, y, z. Tomorrow, swallow y, z, x. The next day z,...
asked by 15.12.2015 / 21:16
1
answer

MySQL select random with priorities

I have the following scenario, I have a table and I need to make a select with an order by RAND (). But I'd like to put some conditions for example: TABELA ID | NOME | IDADE | GRUPO    Data 1 | Hiago | 20 | 1 2 | Igor | 15| 1 3 | Ana| 18...
asked by 21.11.2015 / 02:02
0
answers

MYSQL 5.6 does not recognize the query as it should

Greetings! I'm building a query to take every moment the value was at 0 on a given day and the highest time of the day before. The data in my database is similar to the one I put in SQL Fiddle . Time_Stamp and Value column. So far, I have...
asked by 07.12.2018 / 18:54
0
answers

Select with SUM until sum B is equal to or less than A

I have two tables, products and lots: Products codigo qtdatual Lots codigo qtdlote validade A% example would be: SELECT P.CODIGO, L.QTDLOTE, L.VALIDADE FROM LOTES L INNER JOIN PRODUTOS P ON(P.CODIGO = L.CODIGO) WHERE (P.QTDATU...
asked by 17.08.2018 / 15:05
1
answer

Build SQL to generate a dataset and populate a Treeview

I'm having a database here and I'm looking to set up a SQL to generate a dataset in Delphi and then populate a Treeview. The figure below shows part of the bank, but that is the general structure of it: Basicallytheuserlogsintothesystem(tbuse...
asked by 23.06.2015 / 14:45