Questions tagged as 'sql'

1
answer

Begin Transaction and Save Transaction SQL Server

I have a StoredProcedure on a system I'm working on and I have the following code begin transaction; save transaction Integration_SP; -- CODIGO commit transaction; I've been searching and only found comparisons between BEGIN and SAVE transa...
asked by 28.05.2018 / 13:32
1
answer

Query Database between tables

Database has 4 tables tabela 1 |escola|descricao| tabela 2 |matricula|nome|estado| tabela 3 |matricula|escola|posicao| tabela 4 |matricula|diretor|nome I need to do a search by state (in table 2) and return the results:    Enrollment,...
asked by 09.04.2018 / 17:08
1
answer

How to disable a constraint in ORACLE?

I have a table where two specific fields together can not have the same values. BELIEVE what they are: NUM_DIVISION COD_INDICATOR Assuming I have this data: NUM_PERIODO_LANCAMENTO = 1 , COD_INDICADOR = 1 , COD_CR_PERIODO = 1 NUM...
asked by 02.06.2014 / 17:05
3
answers

Group records from different tables

How can I get the number of identical names from 2 tables, customer and suppliers. Ex: The result is Name. Qtd Joao. 2 Pedro. 15 Miguel. 7 The code I have is the following. Select nome from fornecedores where ativo = 1 Union...
asked by 11.03.2018 / 23:11
2
answers

Select to display the column names of a table?

Tables col1| col2| col3| ...| coln 1 | 2 | 3 | ...| n Display the name: col1 col2 col3 ... coln     
asked by 07.03.2018 / 21:00
2
answers

Convert HTML5 table + images to CSV or SQL

I have a big problem! I have basically 1 million and a half records including images in an HTML5 table (it starts right there, the browser does not render all the images). My idea was to convert this table to CSV, and thus play to a MySQL...
asked by 19.10.2017 / 07:34
2
answers

Auto increment unique in all DB tables

Hello, my DB has several tables that have the same column: 'PROD' int(11) NOT NULL AUTO_INCREMENT This column is an identifier that makes one that increments each launch. The question is that it takes the same value from the other tables, i...
asked by 31.10.2017 / 14:50
1
answer

Select the most recent record of a given table - PostgreSQL

I need to select the most recent record of my Estoque if the data column is different, I was able to bring the oldest one when the dates are different: SELECT codigosuprimento, numeroserie, max(data) FROM public.estoque where usa...
asked by 31.10.2017 / 12:33
3
answers

NOT EXIST? How to use [closed]

Person, I need help, I need to filter only people who have plans X, Y and Z that are not in the other table For example: I have a table of plans, where inside it has 50 plans, however, only 5 have some characteristics of the product, and in a...
asked by 01.06.2017 / 20:13
1
answer

Delete record comparing values between two tables

I have two tables: produtos - id_produto valores - id_produto id_produto would be a column, same for both tables. I need to delete records from the values table, but only those that are NOT also in the products table. Ex:...
asked by 05.04.2018 / 19:16