Questions tagged as 'sql'

1
answer

Select two time fields where one of them moves past midnight

I have two tables with the following schema: data | hora ini | hora fim -----------|------------|--------- 16/08/2016 | 1115 | 1319 16/08/2016 | 1320 | 1419 16/08/2016 | 1420 | 90 In the second table, it already ha...
asked by 17.08.2016 / 22:26
1
answer

XtraGridView - Where with variable

Have a good night, how are you? I'm creating a user registration screen, where every user has an ID, on this screen, I have an xtragridview, which loads some address information. However, in this xtragridview table, you have addresses of s...
asked by 10.07.2016 / 01:44
0
answers

Case nested inside another case

I have a lot of questions about CASE ANINHADO. I have to make an interest calculation that depends on some variables and I'm not able to set up this case, so I need your help to set it up. E1_VENCREA GETDATE ZERO (0) because you still...
asked by 20.07.2016 / 21:57
1
answer

How to select a table row and display information in another table relative to the table?

I am using this code but I am not able to interconnect them as it should be ... I wanted to register Payments (payments) so these only appear when you have to select the partner in the (partner) table ... String sql = "SELECT socio.*,...
asked by 01.07.2016 / 02:28
2
answers

MySQL error "expects parameter 1 to be resource, boolean given in"

$query = "Select * from servico where ID_SERVICO = $id"; $result = mysql_query($query); if($row = mysql_fetch_array($result)) { $nome = $row['NOME']; if($nome == 'Marketing') { include ("servicos/marketing.php"); }...
asked by 07.08.2014 / 19:13
0
answers

query problem Mysql (subquery) difference between MYSQL versions.

I have a problem in a MYSQL query, I believe it is a difference of versions of MYSQL, the bank of my client is in the hostGator (Database client version: libmysql - 5.1.73 / Server version: 5.6.30 - MySQL Community Server) , I made a backup of...
asked by 27.07.2016 / 05:30
0
answers

SQL-Count for each id

I want to show all records in the student table - name and number - and then in the right column, show the percentage of attendance. Let's see: SELECT nome, numero, ( ( SELECT COUNT(aluno.numero) FROM aluno JOIN aula ON aluno.id_aula_aluno =...
asked by 29.06.2016 / 16:38
2
answers

Order by or filter in join Sql Server

You can use order by or some filter in inner join or left join or I'm trying to do this in the wrong way. I need to bring in a query a column that is in a daughter table, but I need to be the most recent record column of the daughter table recor...
asked by 30.07.2016 / 16:49
2
answers

Filter date by time intervals until the last possible hour within the same day

The rule All records that are within a 1-hour interval should be counted as 1 records only. Data ID DATA 1 06/07/2017 09:20:35 2 06/07/2017 10:20:35 3 06/07/2017 10:25:30 4 06/07/2017 10:40:35 5 06/07/20...
asked by 06.07.2016 / 15:47
1
answer

What is the error in the last row of UPDATE usage in the MySQL language?

I developed a final project without error, done in Java, but I still only have a UPDATE error in the last line of the database creation clientes of the database in the MySQL language. I am asking to update the data. public void a...
asked by 20.06.2016 / 18:16