Questions tagged as 'sql'

0
answers

Select in Millions of SQL Server Records

Good morning, I have a database with more than 11 million records, when I do a select on top of the two tables to bring the records to the query takes a lot, I would like to know how I could improve these performance ... Currently with thi...
asked by 28.09.2018 / 15:56
1
answer

Join SQL server

Good afternoon, I started working with sql 3 months ago and I'm getting caught up in an application. I have 3 tables which I have information associated with the "registry" I would like to get all the information from the first table named...
asked by 15.08.2018 / 22:36
1
answer

Display message according to condition in query

I'm making the difference between dates, when the designacao_circuito column is the same, and the difference (days) between dt_hr_fecom is < = 10, I need it in Reinc_10_Dias column to write Reincidente =<10 dias...
asked by 16.08.2018 / 14:22
1
answer

Rankin in MySQL

I'm trying to generate a ranking of faults for HR. Fault logging is done in a separate table in the Employee registry. I need to bring the list of active employees and the amount of absences he has had in the company, but I want to order from...
asked by 31.08.2018 / 16:14
0
answers

Run ALTER on a PROCEDURE that is referenced by another object

I'm trying to change / drop the function [xxxx] according to the code. But I get the following error Msg 3729, Level 16, State 3, Procedure xxxxx, Line 1 [Batch Start Line 15] Cannot ALTER 'dbo.xxxxx' because it is being reference...
asked by 31.08.2018 / 20:23
0
answers

How to name constraints in MySql?

I'm trying to name constraints in MySQL but without success, I'm doing it as follows: create table if not exists pessoas ( id int auto_increment, nome varchar(30) not null, data_nascimento date, constraint pk_pess...
asked by 19.08.2018 / 07:51
2
answers

Search for entire month ORACLE

I need to run a report that returns the values for the entire previous month. It used the following form: where cliente.dtultcomp > trunc (SYSDATE-30) But there are cases of the month having 28, 31 days for example. Is there a way to alw...
asked by 08.08.2018 / 18:43
0
answers

Get title of wordpress post by SQL

Well, I need something like this: $titulo = get_the_title( $post_id ); update wp_posts set post_content = replace(post_content,'>Episódio','>$titulo Episódio'); I know it's completely wrong, but maybe it helps you understand better. I...
asked by 09.08.2018 / 04:53
0
answers

Column number of supplied values does not mach table definition - SQL SERVER

I have the following problem in the sql server when I put the CASE clause at the end of this line of code: DECLARE @RESULTADO TABLE ( Total INT, GrupoTitulo VARCHAR(255), GrupoChave VARCHAR(255), GrupoNome VARCHAR(255), GrupoOrdem VARCHAR(255)...
asked by 10.08.2018 / 13:49
2
answers

Connecting to database in amazon

Good afternoon, I have a sqlserver database hosted in amazon, and I can not connect to php, is there any specific way of doing this? I tried the connection this way: <?php $servername = "link do server"; $username = "usuario"; $password...
asked by 23.08.2018 / 19:11