Questions tagged as 'sql'

1
answer

Maximum number of rows from a mysql import

Well, I'm importing all my database, since I changed the computer, I exported it from the old one, and I want to import it into the new one, but when I import, I get an error: "tempo limite alcançado, envie novamente o arquivo para continuar"...
asked by 01.07.2017 / 23:03
1
answer

Help with Trigger that adds / subtracts

I need help to create a Trigger in SQL Server that takes a value INTEIRO , and two STRING(FK) , inserted in a tabela X , and check if the second value is 1 or 2 , if for 1 it must add this value INTEIRO...
asked by 01.07.2017 / 05:25
1
answer

Query on two tables with count

I have a table in mysql that has a number of contracted items. Table itens_contratados    contracted id   Item   Qtd_contracted Table servico , in this I inform the service that I executed in the contract    contract_...
asked by 13.07.2017 / 19:06
1
answer

How to make a change in "Cascade" using oracle

How can I change the ID of my table BANDAS_E_ARTISTAS and ensure that other foreign tables also change via PL / SQL? TABLE BANDAS_E_ARTISTAS ID NOME_ARTISTICO 01 RAÇA NEGRA 02 OS MENUDOS 03 KELLY KEY 04 LUIZ CARLOS --------------------------...
asked by 30.05.2017 / 14:58
1
answer

Subtract a value from a sum (SUM) in SQL?

Good afternoon! I have a SQL query, which fetches and adds the amount of credits a given user has: SELECT *, SUM(quantidade) as total_creditos FROM creditos INNER JOIN usuarios ON creditos.id_usuario = usuarios.id WHERE creditos.id_usuario = '...
asked by 30.05.2017 / 20:11
2
answers

A separate city query sql

My sales chart marks: city for which the sale was made, date and time of sale. I would like to pull all sales sorted by date and time, but with a specific city separately. For example: Sale 12 - Brasilia - 2017-05-29 10:00:00 Sale 20 - Brasil...
asked by 29.05.2017 / 16:07
2
answers

Select in Sql Server

Good morning. I have a table with columns Version , Updated , LastChanged . I want to make a query to select the highest value of the version, with its LastChanged , corresponding to Updated = 1; I did, but it d...
asked by 18.05.2017 / 12:14
2
answers

Search Records that are not in another table

Good morning .. I have table [BCT_PESSOA] with PK [ID_PESSOA] this table has relationship with table [BCS_USUARIO] with column [ID_PESSOA] I would like to return all records in the [BCT_PESSOA] table that...
asked by 11.05.2017 / 18:20
2
answers

LISTAGG function returning repeated values

I have a multivalued field in which I need the result to return on a single line, so I'm trying to use LISTAGG, but it returns one value per line and each value repeated 5x. Any ideas? I'll paste the code to make it clearer. SELECT DIS...
asked by 08.06.2017 / 17:54
2
answers

Find out which column would be truncated (data would be truncated)

Good evening! When I try to insert a record in SQLServer through my application I am getting a truncated data message. The problem is that there are many columns that this screen fills and I have no idea which one is being truncated. Is there an...
asked by 02.05.2017 / 23:13