Questions tagged as 'sql'

1
answer

Group and add in mysql. to create a report

I have the following table and I want to Group and add as in the following example that I put to you. I commented that this table I will have in a view since it is the result of several tables. =) DESIRED RESULT ... I do...
asked by 23.01.2018 / 06:13
1
answer

Which record is repeated more times SQL

Good afternoon I have three tables in sql I want to know which is the best-selling product EYE I do not need to have the stock as data create table Producto( id_prod int primary key, nombre varchar(15) Precio decimal(2,2) ) create table Vent...
asked by 06.01.2018 / 19:20
1
answer

how to generate a varchar sequence in sql server 2014?

I want to make this column ID that is a varchar field be generated automatically, when I insert the name, as if it were a sequence, help     
asked by 13.12.2017 / 19:12
1
answer

group table values DISTINCT

I have the following table: ENVIO ORDEN LOTE 00011 1 6666 00011 2 6666 00012 3 7777 00012 4 7777 00012 5 8888 00013 6 9999 I need to get from that table, the following: ENVIO CTDORDEN LOTE 00...
asked by 29.11.2017 / 19:41
1
answer

CASE judgments

How one more case is added to do the following: horasExtra= case when horasMes>PlanWorkHours then abs(PlanWorkHours-horasMes) horasFaltantes= case when horasMes<PlanWorkHours then abs(PlanWorkHours-horasMes) end In the c...
asked by 03.01.2018 / 21:09
1
answer

Error ORA-00905 when creating table

I'm starting to model a database. I started with a table first (later I could add more elements) but when entering the code to SQL Developer, this error appears: Informe de error - ORA-00905: missing keyword 00905. 00000 - "missing keyword" *...
asked by 03.01.2018 / 20:00
1
answer

Create a table copy

Greetings. I have a table (basic_data), when generating a "new project", each project inherits basic_data. But when the user wants to edit these, the ideal is that these modifications are in a table "data_basicos_editables", that is to say where...
asked by 15.12.2017 / 15:54
1
answer

copy records from a table with foreign keys

by inserting the ReprteRegresado table and copying the data from the report table: INSERT INTO [dbo].[ReporteEgresado] ([Observacion_ReporteEgresado] ,[Sancion_ReporteEgresado] ,[Fecha_ReporteEgresado]...
asked by 13.12.2017 / 23:51
1
answer

Can not truncate table 'Table' because it is being referenced by a FOREIGN KEY constraint

Hi, I am trying to truncate ( TRUNCATE ) a database, but I have the problem that some tables are related so when I try to throw the query, it says:    Can not truncate table 'Table' because it is being referenced by a FOREIGN KEY constr...
asked by 03.11.2017 / 17:34
2
answers

DBMS output is not displayed in Oracle SQL Developer

For some reason, when executing the following code, the result of the query is not shown by the output of dbms. The same code has been tested on another PC and it works. For the script output shows that everything went well:    PL / SQL proce...
asked by 23.11.2017 / 09:26