Questions tagged as 'sql'

0
answers

How could better performance of a SELECT with several INNER JOIN

I have SELECT with several INNER JOIN and some functions like replace , if .. This SELECT gets all the info I need, but it takes a long time. Is there any way to optimize this SELECT ? SELECT as_as...
asked by 06.06.2018 / 22:33
0
answers

How to create a total column in PIVOT

I have the following column RA COD_CADASTRO COD_TURMA SEMESTRE SITUACAO ---------- --------------------------------------- ---------- ---------- --------------- 917606337...
asked by 09.06.2018 / 17:47
0
answers

How to align the result of Select

I'm working on a report, where I get the name of a person, and on what days it works. I was able to do this select, but I need the result to look like this: [JOÃO - SEG/QUART] [MARIA - TERÇ/QUINT] [JOSÉ - SEG/TER/QUART] I've used (xmlagg)...
asked by 04.06.2018 / 20:35
1
answer

Deploy rows in a date range

I have a question regarding SQL SERVER and I needed your help. I have a Query that returns a line with a number, Start_Date and End_Date. Inquiry: select 123456 as Numero, a.Data_inicio, a.Data_fim from CLI_INTERNAMENTOS_UTENTES a where a...
asked by 01.06.2018 / 20:10
1
answer

Isnull get the next SQL condition

How can I do it on SQL server a condition if the return of a field is null and it returns another condition ISNULL( CONVERT(CHAR(08),C.PEDS_DAT_FAT,112), d.NFFE_DAT_ENT) BETWEEN '20180501' AND '20180530') I'm not sure what to do, b...
asked by 07.06.2018 / 22:59
0
answers

Questions about Picker in Xamarin.forms

I am creating a mobile application in which the user can register x ingredients and later can register products choosing which of the registered ingredients that product uses. In this perspective: Doubt 1 : I am trying to popular a Picker wi...
asked by 06.06.2018 / 00:43
1
answer

Error creating Trigger with more than one table

I'm having trouble creating a Trigger that modifies more than one table. DROP TRIGGER IF EXISTS vendedor_pago; DELIMITER $$ CREATE TRIGGER vendedor_pago AFTER UPDATE ON parcelas FOR EACH ROW BEGIN UPDATE vendas, comissao, parcelas...
asked by 05.06.2018 / 22:45
1
answer

Doubt Case SqlServer

I'm using the following case: CASE WHEN RESPOSTA.CD_RESPOSTA = 1 THEN 'ATENDE' WHEN RESPOSTA.CD_RESPOSTA = 2 THEN 'NÃO ATENDE' ELSE 'NÃO APLICÁVEL' END AS DS_RESPOSTA I have the value of ANSWER.CD_RESPOSTA: 2. The field is an I...
asked by 29.05.2018 / 15:54
1
answer

Make Mysql query with 3 tables

I have the following query that should bring the sum of views and last view (table sir_ter_relatorios_terrenos ), sum of favorites (table sir_ter_favoritos ) and person name (table sir_users ) SELECT u.id as idinc, u.name as...
asked by 29.05.2018 / 15:24
0
answers

I can not download the header from the .csv file

I'm trying to download data from a table in csv format with header but getting the following error: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'Dtremessa' in 'field list' at sun.reflect.NativeConstructorAccessorI...
asked by 28.05.2018 / 17:02