Questions tagged as 'sql'

1
answer

Automatic mail in sql server 2012

I have a problem when putting the query in the body of the email, it is giving me error asking EXISTS in the query how can I solve this. Follow my code. DECLARE @p_body as nvarchar(max), @p_subject as nvarchar(max) DECLARE @p_recipients as...
asked by 04.07.2018 / 14:26
1
answer

Multiple rows in a Sql Server column

I have a problem where I need to merge the query return into two tables in a single row. I thought about using PIVOT but could not because of INNER JOIN . The query looks like this: SET LANGUAGE us_english; SELECT CONVERT(V...
asked by 04.07.2018 / 14:16
1
answer

Delete rows from a table except a MYSQL amount

I have in a table the columns: codigo, cliente, token_md, val, cartcodigo, clientenome, clientesobrenome, clientecpf, clientenascimento I need to delete exactly 46,550 rows from this table, with no worries of order.     
asked by 06.06.2018 / 20:37
2
answers

Bring records from one table according to another's where

I am a newbie in the database area and I came across a situation that I do not know how to solve. Even looking (at least it seems, rs) simple. There is the table called dbo.FISICA and another call dbo.MATRICULA , in the dbo.FI...
asked by 07.06.2018 / 01:04
0
answers

Connecting C # to SQL Server

I am trying to connect a program to the database hosted in SQL Server, but I am having problems .. When the program runs, the login screen is the first one to appear, and it needs to open the second screen with options to add payments and etc...
asked by 09.07.2018 / 01:45
1
answer

Excel and SQL - Connection between Excel file

I have the (final) code I got on the internet. In this line of code it gives error in WHERE, since it is a text: strSQL = " SELECT [VENDAS$].[Data], [VENDAS$].[Vendedor], [VENDAS$].[Total]" & _ " FROM [VENDAS$] WHERE [VENDAS$].[Vendedor] =...
asked by 07.07.2018 / 22:12
1
answer

How to perform shifted SQL query from 1 position?

I am trying to perform a query where in one of the columns ( COTA_DIA_ANTERIOR ) returns me the value of the previous day. But it's bringing the value of the day. SELECT ET.DT_REFERENCIA ,ET.VL_PU ,(SELECT TOP (1) [DT_REFEREN...
asked by 09.07.2018 / 22:58
0
answers

CRUD Android doubts

Good afternoon I have 3 questions about a crud I made in my app. 1 I did a field search and it looks like it does not pick up any phone in the j7 line and I wanted to know if anyone can tell me why 2 Crud needs you to put something in Mani...
asked by 29.05.2018 / 21:09
0
answers

Query to return followers of friends

I'm starting in SQL and I'm having trouble making a query with multiple rows returned. I'm creating a generic twitter clone.    Goal: Return users who are followed by people who   logged in user follows and displays as people he or s...
asked by 29.05.2018 / 18:28
1
answer

LEFT OUTER JOIN

I have a table in PostgreSQL. I would like to count two columns where one has more record than the other. If I use LEFT OUTER JOIN I think it will work, though, I'm not getting with the PostgreSQL syntax. The command I am using is as follows:...
asked by 15.06.2018 / 16:48