Questions tagged as 'sql'

1
answer

SQL - Problem naming variables [closed]

As I can not explain my problem well, I'll give you an example: select cod_prod, sum(quantidade) as "Quantidade 2013", sum(quantidade) as "Quantidade 2014" from itens group by cod_prod having "Quantidade 2013" in ... The above example is no...
asked by 31.10.2016 / 01:45
2
answers

Field type suitable for saving currency in Oracle

Is there any problem in saving data with a comma or period (.) in my database (SQL Developer)? What is the most appropriate variable to declare for currency (price) fields?     
asked by 15.10.2016 / 01:58
1
answer

Connection String C # EntityFramework [closed]

I would continue a work from home project, the Connection String that works is as follows: <add name="DBModel" connectionString="data source=PD_22;initial catalog=EXERCICIO_ENTITY_JOSEEDUARDO;user id=login;password=senha;MultipleActiveResu...
asked by 23.10.2016 / 20:26
1
answer

SQL database structure of a bookstore [closed]

I need to write and populate a MySQL database on controlling a bookstore. This involves: 3 tables: | publisher | book | author | The 'publisher' table should have: id, name, city, state, country. The 'book' table should have: ISBN, name, y...
asked by 17.10.2016 / 02:53
1
answer

How to know how many sales for each of the months?

I need to set up a query that brings the total sales of each month from a table called sales.SalesOrderHeader , but I'm not getting it. In this table there is a field OrderDate which is the date of sale and TotalDue is the va...
asked by 14.08.2017 / 19:34
1
answer

Update via value difference by id

I'm trying to perform an update through this select, where I see the different data from the pen_cadastro table, but when trying to perform an update, it presents errors: [MYSQL] UPDATE: begin transaction UPDATE pen_cadastro as CADAS...
asked by 25.07.2017 / 16:37
1
answer

Select only the first row of each user

I have a table where I move balance (deposits and withdrawal), but in a field of the site I need to bring only the balance of the first deposit. It would look something like this: select saldo from historico where id = :id and (algum filtro...
asked by 29.12.2018 / 19:16
3
answers

PHP- of the error but sends in the same what is requested [closed]

I have the following code, if you do not make a particular request it issues an error, if there is no such error send email to the user. the problem is that in addition to appearing the error and also send the email (see the photo). <?php...
asked by 19.05.2017 / 21:40
1
answer

What to do when this happens?

I'm working on a system in which I must register various data from a form in different tables using mysql. It works like this: The person does a registration and in the same form requests a special attention, I save his data normally and with hi...
asked by 24.05.2017 / 21:06
1
answer

Query returns nothing [closed]

I am making an android application with sqlite feature but I am not able to return anything with these where statments . I have the following table:    id day month value1 value2 and the following cursor: resultado = db.rawQuery(...
asked by 23.08.2016 / 08:20