Questions tagged as 'sql'

1
answer

MySQL - Select comparing fields from the same table

I know it must be simple, but I'm having trouble solving it. I have a table called "enterprise". In this table, I have 4 specific fields that store different ID's from other records in that same table. Example of the enterprise table.     The...
asked by 12.07.2017 / 15:42
0
answers

How to save values from a vector in a database?

I'm creating an Android app for tcc. I have 3 vectors: coorx[i]; coory[i]; busy[i] . This busy vector is not fixed, so the values have changed according to what the user requests. So I would have to save the value of that busy in a databas...
asked by 07.07.2017 / 00:05
1
answer

Firebird 2.5 Querying a procedure

I'm using this code to bring all the calls from the previous months being -1 last month, -2 the previous month to last month, however I need to bring the 3 results (-1, -2, 3) What should I change? SELECT COUNT (*) FROM R_ATENDIMENTOS_TRIMES...
asked by 05.07.2017 / 20:25
1
answer

SQL SERVER Count of items in a Calculated Field [duplicate]

Good afternoon, I'm having trouble counting items in SQL SERVER, I need to perform the count of a column that I EVEN CREATE, where there is a rule, and there are several errors in my tests, errors in GroupBy among others, I need to count th...
asked by 10.07.2017 / 21:50
1
answer

Regex function whitespace SQL Server 2008 [duplicate]

Hello, Within a specific table in my DB, I have certain fields that have been registered by others, so some fields instead of having a simple space ' ' , have spaces of the most diverse types! I do the Javascript treatment as follows:...
asked by 17.07.2017 / 16:16
1
answer

how to bring ten best averages in mysql?

I have two tables: participants and results. In the table of participants I have idParticipant as pk and name; in the results table I have idParticipant as fk, result and date. For the result to enter the ranking the participants must inform...
asked by 23.07.2017 / 06:05
3
answers

Doubt SQL Query d

I am wanting to perform the calculation in the sql query where the result is the amount of open calls divided by the number of weekdays chosen period. Ex: 200 calls have been opened in the month and there are 17 working days in the month of May,...
asked by 30.06.2017 / 16:13
2
answers

Sum with inner join Oracle

People need help, I need to create a report that shows the total quantity of each product in stock, but I can not get the name of the products, only the product code and the sum of the quantity of the products I have. Here is the code I did: S...
asked by 30.06.2017 / 15:57
0
answers

My select is not generating result

I'm doing a select, this same select tested in the database returns me the information I need, but in my .net code an error is saying that it is not generating a result, what will I be doing wrong var NomeFuncionario = conexao.executeSelect("T...
asked by 29.06.2017 / 19:02
1
answer

Pulling the last information from a table [closed]

I wanted to know how to pull the last information that was registered in the bank, but I can not use the ID. In my Route table you have the columns Id (PK), Date, Current_Malue, Combustivel and NVeiculoId (CK). In this table I need to get...
asked by 03.07.2017 / 21:31