Questions tagged as 'sql'

2
answers

Create a join between two classes in my repository

I have a repository for my PessoaCadastro class that relates to the Pessoa class. I need to create a GetJoinAll(...) method that shows me all records in the PessoaCadastro table that are related to Pessoa throu...
asked by 13.02.2018 / 20:51
1
answer

Select related to another select, pulling bank data

I need to create a form that pulls the sql bank options. So far so good, I've done a while inside a query in php; echo '<SELECT NAME = "setor">'; while ( $temp = $setores->fetch_assoc() ) { echo '<OPTION>'.$temp['nom...
asked by 09.10.2017 / 15:14
2
answers

Make a Postgresql bank count

Good morning. I wanted to make a select in my bank and return the number of registrations. Example: tb_client; column: dt_cadastro; In the dt_cadastro column I have this: 2000-01-20 2001-10-05 1990-11-09 1990-07-16 1990-08-10 I...
asked by 23.03.2017 / 14:03
1
answer

Using SSIS to fix extra column error

I'm starting to learn about SSIS, I already know how to import a Flat File into the Bank, however I have a problem, the delimiter used is the Pipe "|", and in one of the columns it is used as value. When importing an extra column is "generate...
asked by 06.07.2017 / 21:26
2
answers

How to get the difference in seconds with Sql Server

I know that to get the difference of seconds between Start and End is like this: Case 1: DECLARE @TB_DIFERENCA_INICIO_FIM as table ( ID int, DataInicio datetime, DataFim datetime ) INSERT INTO @TB_DIFERENCA_INICIO_FIM VALUES (...
asked by 19.10.2018 / 23:35
3
answers

Calculate the average of all records in a table and update the column in MYSQL

I need to make a Query that passes all records in the table and update the rate_general column (this column is the average of the rate_food + rate_service + rate_price + rate_environment / 4 notes) of each record, how to do this? are 20,000 reco...
asked by 03.08.2018 / 20:13
1
answer

INSTEAD OF (Deleted table)

I'm having trouble creating this trigger: CREATE TRIGGER TGmonitoraClientes ON TB_CLIENTES INSTEAD OF DELETE AS BEGIN UPDATE TB_CLIENTES SET clienteAtivo = 0 FROM TB_CLIENTES WHERE CODcliente = deleted.CODcliente INSERT INTO LogClie...
asked by 20.10.2016 / 19:51
1
answer

My SQLServer Express 2014 does not show all installation options

I formatted the PC and I'm trying to install SQLServer Express 2014 with a tutorial on youtube, but when it arrives at that point of my installation, it does not come all the same as the video. Note: I have already installed once and simp...
asked by 12.10.2016 / 19:42
1
answer

Check frequency of records in the table

I have a table where all services performed on several cars are saved. The key is the car license plate. A car can have more than one service a day. And for each service performed a new service id is created, even if it is for the same car. I...
asked by 23.11.2017 / 20:06
1
answer

Test UPDATE in Postgres

The idea is to do a search with the result of BEFORE, execute UPDATE with the appropriate changes and perform a new search with the DEPOIS, then undo all changes, a test for UPDATE. SELECT id_evento, id_statusevento FROM syo_evento WHERE id_ev...
asked by 12.01.2018 / 12:17