Questions tagged as 'sql'

1
answer

Query block Try Catch DO NOT execute the catch block

Good I have the following code to consult and fill a DataGridView with the query but what I try is that if the data that user indicates as a filter does not match any BD record, I execute the Catch block but it does not try {...
asked by 14.12.2018 / 20:37
1
answer

MySQL join / inner join 3 tables

I have 3 related tables. Users, in which I get the following columns (username). Submissions, I get the columns (id, title, thumbnail and rate). It also has the user_id column to know which user made the upload. Favorites, I get the 3 co...
asked by 28.02.2017 / 12:18
2
answers

Print Joins data

Perform the following sql, which has an inner and a left to look up the overhead and individual user data. They are in different tables when doing the sql queries but I do not group the result to show it in the same td, resulting in this...
asked by 30.11.2018 / 06:49
1
answer

Hide database records instead of deleting them [closed]

Recently I had the need to do a car crud, using Rest, Java EE, Angular v.6 and the database in SQL server, but with the difference that instead of deleting the records, they only they are hidden from the user and kept in the database. I want to...
asked by 14.11.2018 / 20:16
2
answers

Make insert in table if there is no POSTGRESQL record

I am trying to make an insert in a table but only insert IF the record I want to enter does not exist, in the case that there is already doing nothing. I've tried it this way, I've just registered the names but the insert is as is: INSERT I...
asked by 14.11.2018 / 17:08
1
answer

Help in procedure or function error ... expects parameter @ ... which was not supplied

MY PROCEDURE IS: ALTER proc [dbo].[spinsertar_detalle_ingreso] @id_detalle_ingreso int output, @id_ingreso int, @id_producto int, @precio_compra money, @precio_venta money, @precio_especial money, @precio_especial2 money, @stock_inicial...
asked by 24.12.2018 / 05:03
1
answer

Convert columns of a table into rows

On a system I am currently working on, there is a table this way Id_Sucursal Id_Servicio F_Descarga Id_Tecnico Con_Costo_1 Id_Producto_1 Cantidad_1 Costo_1 Precio_1 Tipo_1 Oferta_1 Precio_Oferta_1 Cantidad_Oferta_1 Con_Costo_...
asked by 28.12.2018 / 17:42
2
answers

Update Total Accumulated

I need to update the cumulative sales of all the clients in the accumPurchases field, for which I try to add all the invoices of each one and record this value there UPDATE contacts SET accumPurchases = (SELECT SUM(inv_total...
asked by 28.12.2018 / 19:52
2
answers

SQL query with mariadb in which the first 3 rows will be shown and the last row added with their position to make a classification

I'm doing a classification for a game, to do the classification I'm using the following query with MariaDB 10.1.21 : SELECT @rownum:=@rownum+1 'posicion', nombre, dificultad as fallos, palabra, fecha, id F...
asked by 04.01.2019 / 14:17
2
answers

Two Foreign Keys to the Same Field?

I have the doubt if it is valid to create rest tnego this table: CREATE TABLE EQUIPO( id_equipo int not null, nombre varchar(45), encargado varchar (45), tel_encargado varchar(8), PRIMARY KEY (id_equipo) ); and I need to...
asked by 07.11.2018 / 18:19