Questions tagged as 'sql'

2
answers

Parameter error in MySQL with C #

string sql = @"UPDATE ivendas SET nritem=(@rank:=(@rank+1)) where id_venda = 20"; try { MySQLBase basemysql = new MySQLBase(); MySqlCommand cmd = basemysql.connection.CreateCommand(); cmd.CommandText = sql; cmd.CommandTimeout = 10...
asked by 16.01.2018 / 18:37
1
answer

Making a select on all tables in a schema

Is it possible to search for certain values in columns of other tables? Example: I have a number: 23028908 I want to search my bank for all columns that have this value. Is this possible? How can it be done?     
asked by 14.07.2016 / 16:18
1
answer

Select Distinct returns repeated data when I use Row_Number

I'm trying to make paging with SQLServer 2008 as follows: WITH CTEResults AS ( SELECT DISTINCT SolicitacaoServico.AutoId AS Id_Solicitacao, Pessoa.Nome AS Nome, Beneficiario.Codigo A...
asked by 12.02.2016 / 15:03
1
answer

Show alert message without causing an exception

I would like to display an alert message to the user without causing an exception in the procedure. I am using SQL Server. So I can not use RAISERROR , nor PRINT , as it is not shown to the user. Is there a way to display an alert...
asked by 21.11.2016 / 13:45
2
answers

I can not enter user-defined values in SQLite

I have a problem where I can not add anything to the table and the error always appears:    sqlite3.InterfaceError: Error binding parameter 0 - probably   unsupported type. The code I'm trying to add values to and this: p_name=input("...
asked by 30.01.2016 / 14:58
1
answer

Count Values with PHP and SQL

Well, good afternoon. I have the following question. I have a questionnaire with 10 questions, the answers to these questions can be from 0 to 5, I would like to make a while leaving counting the answers. I thought of the following way and...
asked by 22.07.2015 / 22:42
2
answers

Format CPF column with regular expression

In a table containing the CPF column I would like to format it to display the content appropriately. By proper means I mean the format 999.999.999-99 . Is it possible to format this content using regular expression? SQLFiddle for testing...
asked by 27.07.2015 / 19:57
2
answers

List every month in Query or PHP?

I need to list every month within a period, including the ones that did not move, for example: My Query: SELECT LEFT(B8.B8_DTVALID, 06) AS VALIDADE, SUM(B8.B8_SALDO) AS VENCIDO, 0 AS VENCENDO, 0 AS AVENCER FROM SB8030...
asked by 22.07.2015 / 22:25
2
answers

Checks if in a group of values there is a value x mysql

I have a select that returns some data from the database, but I need this select to return values only when in a group of values, there is x SELECT pessoas.id AS ID, pessoas.nom_pessoa AS nome, pessoas.cod_sexo_pes AS sexo, YEAR(FROM_DAYS(TO_D...
asked by 08.06.2016 / 21:08
1
answer

Compare Current Line with Previous [duplicate]

I want in a "Test" column to set the "S" value to only the first line of a given "code" and all others set the value "N" and so on to all other codes in a SELECT, I'm using SQL SERVER. ID COD VLR DATA TESTE 01 123 100 "06/09/2015"...
asked by 16.09.2015 / 21:28