Questions tagged as 'sql'

2
answers

JOIN SQL MULTIPLES TABLES

Good morning, I would like to ask a question, this sql query is working, but repeat the records, any suggestions or corrections select f.periodo 'PERIODO_INFORMADO', s.rut_emp 'RUT_EMPRESA', e.nom_empresa 'DESCRIPCION_RUT',r.id_reg 'REGION...
asked by 17.01.2018 / 13:42
1
answer

optimize reading and inserting records from a .txt to sql in Java

good morning companions I have a code that is responsible for processing a .txt file and inserting it into a SQL database; all this in java using netbeans my code is as follows: String line = null; int exito=0; int numeroBatch=0; int...
asked by 23.01.2018 / 16:29
3
answers

Count repeated cases in SQL

I do not have much experience in SQL and I'm making a mess to solve something that almost certainly is not very complex. I have a table that has a column with an alphanumeric code: columnA {xa1, xa2, xa3, xa3, xa3, xa4, xa4, xa5, xa6, xa6,...
asked by 31.12.2017 / 11:08
1
answer

Check hour of entry and exit of employee night shift in sql

I appeal to you for support and suggestions. I have the following table in SQL: It is the record of entries and exits of employees that keeps a clock, as you will see it is not possible to differentiate inputs from outputs since everyth...
asked by 22.12.2017 / 23:16
3
answers

SQL Beginner Queries

Good, someone knows what I have wrong? I have these 3 tables: PREGUNTAS PREGUNTAS_RESPUESTAS RESPUESTAS idpregunta Idpregunta_res idrespuestas pregunta idpregunta respuesta...
asked by 20.12.2017 / 11:08
2
answers

CAST and CONVERT rounded a float by passing it to varchar - SQL SERVER 2014 - Microsoft SQL Server Management Studio version 12.0.2269.0

Good afternoon, I have a problem when I take the float values from a sql server database and convert them to varchar with CONVERT. This function, I round the float and then it turns it rounded. The same goes for CAST. I need the varchar to be a...
asked by 06.12.2017 / 16:33
1
answer

Differences between FETCH ABSOLUTE and FETCH RELATIVE

I am working with cursors whose behavioral parameter is SCROLL but I do not understand what is the objective of two of its functions when it comes to making the FETCH . I do not understand what they do or what they serve FETCH AB...
asked by 14.06.2018 / 10:47
2
answers

add columns after another in postgresql

I would like to know if there is a way to add columns later after a certain column in postgre, as in mysql that aría in this way alter table personal add capital int not null after nom; I would like to know if there is any way in postgresql...
asked by 06.12.2017 / 22:10
1
answer

Is it possible to generate consecutive ones based on the change of a column in SQL Server?

I have this case: I'm interested in SQL Server 2008, to be able to assign a row to the records but to reset it to 1 every time a date changes in the query. For example I have these data: And I am interested in generating a consecutiv...
asked by 01.12.2017 / 22:25
1
answer

Mysql query, filter

I have a table with People and roles, and I want to select people who do not have the Head of Department role in a selection. The problem is that if you have the role, the user also shows it and I want it to be shown at the moment you have th...
asked by 03.12.2017 / 19:17