Questions tagged as 'sql'

0
answers

Merge two rows in a query

I have my query that shows me my data in this way select Nombre, Deporte, sum(Ganar), sum(perder) from Tabla where CodPersona = 777 group by Nombre, deporte the query shows me the sums of the two sports and repeats t...
asked by 24.05.2018 / 22:46
0
answers

Error when inserting a Postgresql record

I have my created function which receives parameters and I want to insert them in my product table but I get an error CREATE OR REPLACE FUNCTION insertarProducto(_codigo character,_descripcion CHARACTER VARYING,_precio MONEY,_stock INTEGER,_fe...
asked by 29.05.2018 / 21:44
0
answers

ACCESS data grouping

Hello, I have a query in which one two tables with different fields using a person identifier. Among the certain fields I have two with the purchase amounts and in the query I include an expression that divides both amounts and returns the%. The...
asked by 24.05.2018 / 13:14
0
answers

Repeat ACCESS records

Hello, I have a query that links me to two tables, the first contains the identifiers of the people and a field of the purchase they have made, in the second table I have descriptions of the data including the value of the product and a client f...
asked by 24.05.2018 / 13:55
0
answers

SQL My procedure to detect UPDATE dynamically runs slow with large tables

I just finished a trigger to detect if they performed an update to a record in a table, but my table contains more than 30 fields and it takes about 8 seconds to perform the update, being that without the trigger it takes a long time and a half....
asked by 23.05.2018 / 23:59
0
answers

Update stock with trigger

I have 2 tables, a "Products" table composed of the following CREATE TABLE PRODUCTS ( id_product BIGINT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY, code VARCHAR(6) NOT NULL UNIQUE, name VARCHAR(30) NOT NULL, price FLOAT(6,2) UNSIG...
asked by 23.05.2018 / 01:02
1
answer

Multiply id with triggers

I am trying to multiply the ID with a trigger, but it returns the same result. DELIMITER // DROP TRIGGER IF EXISTS incrementID // CREATE TRIGGER incrementID BEFORE UPDATE ON fine FOR EACH ROW BEGIN UPDATE OLD.id SET NEW.id = OLD.id * 1000; EN...
asked by 21.05.2018 / 11:32
0
answers

How can I insert the name of the user that accessed my BD SQL Server in a table?

I would like to know if I can insert the name of the user who accessed my table, that is, your login name in that way could create a simple blog. I know that to insert the date is with getdate() and I would like to know if there is som...
asked by 25.05.2018 / 02:54
0
answers

Problem to visualize the contents of a Column, using FullCalendar

This is a system that allows scheduling the appointments of a local, managed to make it register in the database, however I can not get me to present this information, please if someone has any serious help, for that I'm asking for the last name...
asked by 22.05.2018 / 08:08
1
answer

Query to select certain columns that meet the condition

I have the following table: create table prof_est(id_est int, id_prof int, id_curso int, periodo varchar); id_est corresponds to the student id id_prof is the identification of the teacher who is dictating the subject id_curso is the identi...
asked by 20.05.2018 / 03:22