Questions tagged as 'query'

1
answer

Trigger without replicating data - SQL Server 2012

I have a trigger in the FRM_46 table that would be to replicate the data right after the insert or update for the FRM_31 table, however, it is not replicating, I already analyzed and did the tests, but I could not verify where the error is . A...
asked by 13.11.2017 / 19:28
1
answer

How to bring only a certain part of a text in a field

How do I bring only part of the text in a field in the sql server? I have the query below that in the Description column, it returns a text with lots of information, for example. Nome Cliente Data do ultimo Tramite Descrição Teste...
asked by 27.07.2017 / 13:48
1
answer

Get the last message of a conversation (GROUP BY)

I have the following query: SELECT cp_mensagem.mensagem, cp_mensagem.dh_envio, cp_projeto.id as id_projeto, cp_projeto.nome as nome_projeto, cp_pessoa.id as id_freelancer, cp_pessoa.nome as nome_freelancer FROM c...
asked by 25.04.2014 / 17:58
2
answers

SQL result has field and index

I have a function in PHP to automate the queries I make: //arquivo funcao.php function executaSql($sql, $param=array()){ try { include "config.php"; $q = $conn->prepare($sql); $q->execute($param); $res...
asked by 28.07.2016 / 15:05
2
answers

Difficulty checking in MySQL

Firstly I'm starting to mess with mySQL now I'm very lazy on the subject yet I have a table that is named products_search_items and in this table there are 2 columns product_i" and search_item_id I needed to, for examp...
asked by 13.01.2016 / 16:29
6
answers

Convert varchar to date in SQL

You can convert dates to varchar for date . I'm having difficulty performing cross-date searches because of this discrepancy in the database where I query. When I enter my line of code: select * from TAB_FATURAMENTO where cd_...
asked by 01.06.2017 / 13:55
2
answers

Query with conditional sorting in MySQL

I have a table named comentarios , formed by columns: id , descricao , criado_em and comentario_pai , as you can see in the photo. I need to create a query, in which the answers are printed after your comme...
asked by 11.07.2018 / 20:41
2
answers

Update two tables with condition

I have the following scenario Two Tables Source Table - Destination Table Both with the same fields [ID] [Name] [CPF] The query must go to the [CPF] columns of the two tables, when the [CPF] of Source and Destination are the same, you must...
asked by 16.05.2017 / 19:28
3
answers

Insert data from a combobox into a SELECT

Good afternoon! I have the following problem, I have to withdraw reports from a certain database where I should select specific employees, the same should be selected from a combobox: <select name="usuario" id="usuario"> &l...
asked by 30.04.2015 / 19:02
3
answers

Help with select

I'm using the command select below: select f.no_equipe, h.no_pessoa_fisica, a.no_cidadao, d.dt_ficha from tb_cds_cad_individual a, tb_cds_atend_individual b, rl_cds_atend_individual_ciap c, tb_cds_ficha_atend_individual d, tb_equipe f,...
asked by 06.09.2017 / 19:41