Questions tagged as 'sql'

1
answer

SQL query with Hibernate Criteria

I'm making reports with Hibernate but I had a problem and I can not find a way to do it. The query is this: SELECT mes as mes, COUNT(mes) AS t_mes, SUM(total) AS totales, SUM(cantidad) AS cantidad, SUM(facturado) AS factur...
asked by 04.08.2018 / 01:28
1
answer

Update table with sum

Good morning People, I need the column "Expenses" to be added as new records are being entered. Try to do it with an update, I work in mysql but doing it in sql server throws me an error. The sales id is with the number 3 because before loading...
asked by 07.08.2018 / 14:22
0
answers

Why the error in syntax (SQL server 2008 R2)

the following query: DECLARE @ntp int, @jugador varchar (max)= 'Hola', @Player varchar (max) SET @Jugador = @Player EXEC @ntp = [PS_GameDefs].[dbo].[Command] @serviceName = N'ps_game', @cmmd = N'/ntplayer '+@Player+' '+...
asked by 07.08.2018 / 05:02
1
answer

How to detect an error in SQL Server 2008 R2

It's a question without a script because my doubt is direct. I need to update a Column whose data is X I want to convert it to Y but when I update it gives me the following error: Error converting Varchar to real. so this error occurs i...
asked by 29.07.2018 / 22:57
2
answers

Optimize a Sql by removing the with

I have to calculate the average sale per store-article of the last 7 full weeks. That is, if today is Wednesday 07/25/2018 , it would take the corresponding sale from 04/06/18 to 07/22/2018 . To position myself on those dates I used ne...
asked by 25.07.2018 / 10:30
1
answer

how to select data from a second table according to the user

How can I select the user who logs in to show the name in php, table 1 is for the main users, and table 2 is for additional users, related to the main user by ID and ID_ppl I need to show in php the username that starts the session. but only...
asked by 30.07.2018 / 06:29
1
answer

Problem when displaying data in input

I'm having problems when it shows me the data well in the imput. I have two options one to add and one to edit, adding data is no problem, but when editing, in the imput I printate the data but not everything, that is, for example, if I have an...
asked by 26.07.2018 / 09:29
0
answers

Echo does not show a date when using echo

Hello inside my table I try to show in a table the value "high date" of a base in SQL server and its structure is this: when capturing the value as with any other of the same table and try to imrimir it is deconfigured all my table what do...
asked by 25.07.2018 / 00:00
1
answer

Email with points is not inserted in the database

Currently the project is developed with angular 5, express and a SQL database. When entering an email with points in its structure (for example: [email protected]) it does not enter them into the database. This is my code: add : func...
asked by 03.08.2018 / 00:47
0
answers

Save GIF in PostgreSQL database

Good afternoon I need some help, what I need is to save a GIF in a postgreSQL database. I have a table called words which counts of 4 fields ...    word of type text description of type text GIF of type text   Bytea type resource In th...
asked by 01.08.2018 / 22:25