Questions tagged as 'query'

2
answers

Result Null Coming in query

Good morning, I need a help from you, I have a query on my system that has a problem, it has 4 results, only 1 of those 4 is coming with null value. I'm going to post my query below SELECT Title, SUM(Count) AS Count FROM ( SEL...
asked by 18.09.2017 / 15:35
2
answers

Check if there is a record in the table

I'm trying to check if there is a record in the mysql table using php, I have the table "slug", and in this table I have "id" and "slug_name", as I do to check if there is already a name in this table, for example: noticia_sobre_o_tempo. how...
asked by 24.07.2017 / 15:17
2
answers

Paste previous record - SQL Server 2012

I need to bring only the records where the previous status was 1 , but which is currently 0 . I have a table named solicitação that contains a field called VencimentoPausado , where this field values are 1 or...
asked by 06.08.2017 / 19:57
2
answers

Adds WITH query within another query

People, like adding the query below as a subquery. Query with WITH : WITH tabela (projeto, operadora) AS ( SELECT p.projdesc, tt.tartitulo FROM tarefa tt INNER JOIN projetos p ON p.projid = tt.projid...
asked by 04.08.2017 / 21:09
1
answer

SQL date filter on timestamp

I have the following query: SELECT name, commission, timestamp, state_name FROM magry_awoaffiliate_commission c INNER JOIN magry_users u ON (c.user_id = u.id) INNER JOIN magry_virtuemart_userinfos v ON (c.user_id = v.virtuemart_user_id) INNER...
asked by 30.03.2017 / 21:42
1
answer

Query not working, problem comparing years

Hello, I'm trying to compile a query to perform an insert, as it uses only database data I'm a select for this. My problem is in the where clause where either end of operation has to be null or the year of the end of operation has to be shorter...
asked by 12.01.2017 / 20:17
1
answer

SQL query using several times the same function

I have a function that converts the ID of a version to number, for example, from 1.0.0 to 10000 , so I can filter the results. Function: CREATE OR REPLACE FUNCTION f_convert_tag_to_number(ptag varchar2(12)) RETURN NUMBER IS...
asked by 23.11.2016 / 20:06
1
answer

Update on more than one line

I'm trying to mount a update like this: UPDATE cad_vendas SET canal ='9', parceiro ='9' WHERE cpf_vendedor ='CPF_VENDEDOR' and status_proposta_producao ='90' and forma_pagamento <> ''; but it does not accept if I do not pass the...
asked by 05.06.2017 / 15:25
2
answers

How to join 2 tables without repeating data?

I have 2 tables, one call SR7010 and another call SR3010 . The primary key of the two is the field R7_MAT and R3_MAT. The query I'm trying to perform is this: SELECT R7_FILIAL, R7_MAT, R7_DESCFUN, R7_DATA, R3_VALOR FROM SR701...
asked by 19.08.2016 / 21:15
2
answers

Error message when closing application

I have this code that I use on a login screen, which when the user uses the correct password, it directs to the main screen, so everything okay, it works perfectly, but when I fecho the application it displays a message of the code.   ...
asked by 20.05.2016 / 16:28