Questions tagged as 'sql'

2
answers

Compare values with different conditionals in the same table

When I make a SELECT COUNT(*) in view vwNotaFiscal I get the total of lines: 3498 SELECT COUNT(*) FROM dbo.vwNotaFiscal WHERE tbEmbarques_emissao BETWEEN CONVERT(DATE,'01/05/2016',103) AND CONVERT(DATE,'31/05/2016',103) A...
asked by 04.07.2016 / 20:20
2
answers

word occurrence in sql query

I have a query SELECT NOME FROM PESSOA WHERE CODIGO = 1 It returns me ANA ANA JOAO ANA ALBERTO ANA Is there a way to count the occurrences of the ana? Using only the sql query?     
asked by 18.03.2017 / 21:00
1
answer

Group results in single line according to the sequence

I have the following query: SELECT * FROM ARELBATIDATRANSITOVIEW WHERE CHAPA = 1234 AND CODEMP = 1 AND BATIDA IS NOT NULL It picks me up like this: COD |DATA |BA...
asked by 20.03.2017 / 16:37
1
answer

Create a three-table Viewer

How to create a mysql view with 3 tables the following structure being cliente |id_cliente |nome_cliente produto |id_produto |nome_produto |valor_produto pedido |id_pedido |id_produto |id_cliente I would like to create...
asked by 07.06.2016 / 21:15
2
answers

How to search the database with three types of users?

Hi, I'm doing a college project, it's an internship site project, it has to be developed in Java WEB with database. It has three types of users, the student, the company, and the administrator. I would like to know if there is any way I can log...
asked by 19.10.2016 / 14:46
1
answer

How to concatenate data from a DataGridView and Save in a single field of the database

I want to concatenate and save the fields of a datagridview, however I do not know how to do this. What I Have: method: public void Gravar() { string strQuery; strQuery = "INSERT INTO Prato"; strQuery += (" VALUES("); str...
asked by 16.10.2016 / 05:53
2
answers

Calculate Value of SQL columns

I have two tables BMV_PEDIDO and BMV_PEDIDOITEM and would like the total sum of the value of the orders made on a certain date. Currently I do this by request, that is, I replicate this code 70x. I would like my query to return...
asked by 20.04.2017 / 16:34
3
answers

Get a single record for equal columns

I have an example table: produto | supermercado ---------------------------- 1 | 1 4 | 2 6 | 1 5 | 1 8 | 2 7 | 3 I want to get all the exis...
asked by 11.05.2016 / 19:16
3
answers

Correct SQL database data [closed]

I want to correct a table field, as I have values like this: 123456789 and want to change to 1234567.89     
asked by 04.05.2016 / 15:49
1
answer

How to create this procedure

I have these two tables in the bank cadcha (Cadastro de chamadas) cadram(Cadastroderamal) Allconnectionsmadetoacertaincompanywillbesavedinthistablecadcha.Thedestinationextensionfieldistheextensionthatansweredormadethisconnection.Ialsohavea...
asked by 17.12.2015 / 16:11