Questions tagged as 'sql'

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

Debug Proc in database sql server 2014

I use Sql Server 2014. I am having problems in Stored procedure, because when running with certain filters, I get this error:    Message 512, Level 16, State 1, Procedure   SP_CMO_SEL_PORTARIA_INATIVOS, Line 485 Subquery returned more than 1...
asked by 26.04.2017 / 16:12
1
answer

Query returning duplicate values

People I posted here in the topic SQL Query with Duplicate Items I just have another question I have sql: SELECT TABNOV.CODIGO_ANDAMENTO, TABNOV.NUMERO_PROCESSO, TABNOV.INSTANCIA, TABNOV.DESCRICAO_ANDAMENTO, TABNOV.ACESSO_PUBLICO,...
asked by 13.07.2017 / 20:46
2
answers

How to get the value of one table depending on the maximum value of another?

I have the following code that gives me a table like the one in the picture, but my question is how do I get the name and just the name of the one that has the highest health value that will be the gas? Is it possible to use a NOT EXISTS in this...
asked by 17.11.2017 / 18:46
2
answers

Alternative for MySQL Workbench

Well, I currently use the MySQL Workbench software to make my scripts, I wanted a lighter program, does anyone know / could give me some alternatives? I do not want PHPMYADMIN Note: I'm developing with PHP - I do not know if that influence...
asked by 15.03.2017 / 17:05
3
answers

How to send selected data to an ftp server

I am developing a project in C # and at this point I have to select a row from a DataGridView that I created, create a text file with that data and send the file created to an ftp server. I already did a search, but I could not find anything tha...
asked by 24.08.2017 / 16:40
1
answer

Doubt Laravel SQL Queries?

I'm starting with SQL of Laravel I looked a lot more I did not get a response of how to AND after where , follow sample code to implement AND . SQL: UPDATE contas SET valor_titulo = 0, WHERE id_contrato = 2...
asked by 22.03.2017 / 20:41
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
3
answers

Using the Case When Then command with Entity Framework

I have the following structure corresponding to a table in my Database: Cat_Codigo, Cat_Descricao, Cat_Observacao, Cat_Status Where Cat_Status is defined by 0 or 1, where 0 -> Disabled and 1 - > Active. But I do not want to...
asked by 22.02.2017 / 15:40
2
answers

Query delete with Join mysql

I have a problem with this query, I do not know what's wrong: DELETE FROM mdl_forum_discussions WHERE id IN ( SELECT mdl_forum_discussions.id FROM mdl_forum_discussions LEFT JOIN mdl_forum_posts ON mdl_forum_discussions.id = mdl_for...
asked by 14.02.2017 / 18:01