Questions tagged as 'sql'

2
answers

Error: Can not find data type long

I'm trying to create a procedure in SQL Server 2012, but it's giving the following error in signing it. Mensagem 2715, Nível 16, Estado 3, Procedimento MINHAPROCEDURE, Linha 6 Column, parameter, or variable #1: Cannot find data type long. Para...
asked by 27.09.2015 / 17:24
1
answer

Get data from fields of the same name but from different tables

I have a select that it fetches data from three different tables, but has some fields in common between these three tables. My question is how to get the data from this field, which has the name in common with the other tables. My select look...
asked by 10.12.2014 / 14:32
2
answers

mysql errors being presented in French

All errors I receive regarding phpmyadmin database are in French. However, the panel is in pt-br, only query errors - a select for example - are displayed in French. I use WAMP. EX: Aucune base n'a �t� s�lectionn�e     
asked by 06.01.2016 / 20:05
2
answers

What should Query be for a result of tuples in which the value of a column is 'x'?

I have the following query: $select = "SELECT concat(mid(cpf,1,3),'.',mid(cpf,4,3),'.',mid(cpf,7,3),'-',mid(cpf,10,2)) as cpf, nome, genero, nome_cracha, rg, crm, crm_uf, rua, bairro, cep, cidade, estado, telefone, celular, fax, email, cna...
asked by 31.01.2014 / 16:46
3
answers

How to avoid calculation error in SQL Server?

I have a query that makes a calculation, plus the field "a.costarticles" appears with value zero at times, then it generates a division error by zero, is it possible to pass some default value? Type 1 if it has a value of zero? select a.totalc...
asked by 30.09.2015 / 14:40
1
answer

Perform direct calculations in sql query

How could I perform a series of calculations directly in the sql query, how does SUM() that sum does it have some way of adding one column to another and decreasing another? $sql02 = mysql_query("SELECT * , SUM(valor) as tt FROM finan...
asked by 30.01.2017 / 23:57
2
answers

SQL to compare hours and minutes when Timestamp in PostgreSql

I am trying to compare 2 timestamp fields, which have different dates, ignoring the dates and using only the hour / minute simultaneously, to know, within one day which one is larger. EX: '2000-10-10 10:00:22' > '2000-02-02 11:00:10' In...
asked by 12.01.2017 / 00:24
1
answer

Transfer and sum values from an SQL column

I have two columns in a table, I need the values in column 1 to be transferred and added to the values in column 2. Can this be done with a PHP or is there some easier way to do it? Original: ID / 1 / 2 / 1 150 100 2 200 50 3...
asked by 06.08.2015 / 23:29
2
answers

How to create a report in Sql Server with information by date

I am creating a system for output management, one of my tables stores the output history information, it has the following columns, IDpedido, DataDoPedido CodProduto, QuantidadeProduto CustoProduto (preço de custo) VendaProduto (preço de venda...
asked by 25.04.2018 / 19:37
1
answer

Check current date automatically

I'm developing a system with PHP where: I've made available a contest entry page for staff, but this page has an end time, example: The page will be available from today 05/08/18: 17:11 and will disappear on 09/05/18 23:59:00. I know I ca...
asked by 08.05.2018 / 22:16