Questions tagged as 'sql'

1
answer

How to use Scope_Identify to return .NET id

I'm developing an application and I need it when sql does the insert return the value of the id that was entered, I'm using the following command SqlCommand cmd = new SqlCommand("insert into solicitacoes (assunto, mensagem, endereco, anexo, st...
asked by 05.06.2015 / 14:31
2
answers

SQL - put null values in 0

I have a pivot table that returns me some null values in SUM(1) . I wanted them to be zero rather than null, but I can not. Original pivot table SELECT Description AS Categoria, [ACS], [URO] FROM (...
asked by 02.06.2015 / 13:31
1
answer

How to merge lines?

How can I merge two or more **Linhas x Coluna** of the query below? select cast(OS.CreateDate as date) as DtMovimentacao, OS.Id as NrOS, OS.Description Origem, OSI.Description as ItemSaida, OSI.Quantity as QtdSaida, OSE.Description, OSE...
asked by 04.12.2015 / 17:43
1
answer

Identifying and tagging SQL script keywords within a Word document [closed]

I'm doing a system error manual for the company where I work. Within this manual you will have the description of the error, as well as its solution. Many of the solutions are very extensive SQL scripts. I wonder if it's possible to mark (lea...
asked by 11.12.2015 / 13:51
1
answer

Problem with Like for Criteria

Good morning. I have a table in the following format: Ineedtomakeaselecttoreturnthesumofthevaluesoftheinfrastructuregroupedbyyear.IcreatedthisqueryinSQL:selectYEAR(dataCompraInfra),sum(valorCompraInfra),sum(valorVendaInfra)fromconcessaoin...
asked by 05.09.2015 / 15:55
1
answer

Concatenation Create Table

I'm trying to create a table from the user's email, and I'm using the code below: $email = $_SESSION["email"]; echo $email; $create=mysql_query("CREATE TABLE userpics_'$email' (id_user VARCHAR(60), id_pic VARCHAR(200), id_tipo INT(2))");...
asked by 21.04.2015 / 21:50
2
answers

How to get date and time in different columns through a select Sql server?

I'm having a problem filtering a query under the following conditions: I have the Date field and I have the field time both in varchar, when I try to do the query like this: ex: select Serial, Latitude,Longitude,Data,Hora from [CheckPoint...
asked by 20.04.2015 / 14:58
1
answer

Save user message to text file or database? [closed]

I'm developing a system in PHP following the MVC (Model-View-Controller) standard. I have decided to create an account exclusion page for users and display a text field so they can tell us why they are leaving the system. My question is whether...
asked by 30.06.2015 / 19:34
1
answer

delete record from an sql table

Good people I want to erase a record from a table but for this I need to go get information from other tables and because of this I am not able to delete. I basically needed an SQL command that would receive the patient id from the patient t...
asked by 06.05.2015 / 20:39
1
answer

PDO Switch Case Does Not Display

Changed more within the title yet, the case works but does not display the result. <?php $sql = "SELECT tipo FROM publicidade WHERE posicao='Lateral' ORDER BY RAND() LIMIT 1"; $stmt = DB::prepare($sql); $stmt->execute(); $exibe = $stmt-...
asked by 10.03.2015 / 18:09