Questions tagged as 'sql'

1
answer

Constrait unique Oracle

I'm in doubt, when I create a CONSTRAINT UNIQUE , does it evaluate all the columns together? For example, I want a country not to have names or acronyms , in which case should I create CONSTRAINT different? Because I...
asked by 30.07.2017 / 16:26
1
answer

Laravel SQL returning with interrogation?

I am doing a query on Laravel and it is returning the date with the following value. select 'campo' from 'tabela' where 'campodotipodata' = ? Well it returns SQL , it follows code in LARAVEL $vardata = date('Y-m-d'); $...
asked by 28.07.2017 / 02:48
1
answer

Access SQL Server database via CMD

In Oracle I know how to access and execute queries through sqlplus in CMD. Does anyone know if SQL SERVER also has a similar command?     
asked by 06.06.2017 / 21:13
2
answers

Is it possible to perform an Update in this way?

I have two tables, the Impressoras table is where the equipment data, such as model, assets, etc., is stored. And I have the Impressora Local table where the location where the printer is located is stored, the client where it is c...
asked by 10.07.2017 / 16:09
1
answer

How to perform a SQL command that takes several lines

I have a table where there are several records of supplies, now a column will be implemented in this table where a label will be implemented to facilitate finding these supplies in stock, I have already adjusted the table so that all new records...
asked by 21.07.2017 / 19:23
2
answers

Select Chained

Hello, I'm having a question about a select chained. I found many examples with select * from (select campo from tabela) However I want to define the fields of my query, as below: select campo1,campo2,(select campo1 from tabela2) from ta...
asked by 03.08.2017 / 16:42
2
answers

Return last record of each object [closed]

I have the following table: imovel ano | id | item | valor Records: 2000| 1 | 201 | null 2001| 1 | 211 | 10 2002| 1 | 202 | null 2000| 2 | 201 | null 2001| 2 | 221 | 17 2002| 2 | 211 | 14 2000| 3 | 201 | null What I ne...
asked by 03.08.2017 / 15:53
3
answers

Add the values of a count (*) in sql

I'm new to sql and I'm having trouble performing the sum total of values in a count , below the code: SELECT A.Pais, count(*) from Aeroportos A left join Estacoes E on A.Sigla = E.ICAO where E.ICAO IS NULL group by A.Pais order by Pais;...
asked by 17.10.2017 / 02:43
2
answers

Procedure sql server 2012 + java

I want to structure an INSERT using JAVA in the same way that the INSERT is structured in VB .NET. Here's the code in VB .NET: Const _spName = "dbo.MEJT_SP_CAD_PRODUTOS" Public Function IncluirProduto(produto As MEJTProdutoEnt) As Integer...
asked by 16.10.2017 / 22:35
4
answers

Create method that prevents code repetition in ASP.NET with SQL

I'm building a website in ASP.NET, using C #. I want to 'link' the site information (text and images) to a SQL Server database. That part of the connection I've been able to do successfully. However, I have to repeat BD connection encoding...
asked by 15.05.2017 / 16:10