Questions tagged as 'sql'

1
answer

ORA-02253: constraint specification not allowed here

Hello, I have this table created in oracle : CREATE TABLE SUBCONTRACT( CIF CHAR(9) NOT NULL CONSTRAINT PK_SUBCONTRACTS_CIF primary key, NAME VARCHAR2(50) NOT NULL, ADDRESSSTREET varchar2(50) not null, ADDRESSNUM number(7,0) not null, ADDRESS...
asked by 30.11.2018 / 23:49
1
answer

IF nested PL / SQL

Good Morning People; I ask for the collaboration of the community because I can not explain why the second if it is nested is not being evaluated, is not being evaluated and enters if the structure is true or false example (1 = 2) and enters? .....
asked by 23.03.2016 / 14:30
0
answers

How to make this structure in Json from SQL 2017?

I want to convert this structure by selecting data from the table when I select it, I am going to convert it into JSON from the Sql 2017 database. ATTACHMENT MY QUERY Select Medio_Pago AS [medio_pago] from Table_FacturacionElect where Comprob...
asked by 25.11.2018 / 04:08
1
answer

How to make a sum of the result of a query?

I hope you can support me, I need to make the sum of the result of the wages that I throw the previous query. The result I need would only be $ 17,500     
asked by 29.11.2018 / 08:59
0
answers

error with rank on sql server

I have this query on sql server: SELECT distinct(em.id_empleado), al.region, al.des_almacen, al.cadenaventa, em.des_empleado, em.cargo, em.pais, al.id_almacen, T1.ventas, T1.boletas, T1.unidades, T2.trafico, RANK() OVER (ORDER BY T1.boleta...
asked by 21.11.2018 / 20:18
1
answer

Deposit several selected users one by one in database,

The problem that occurs is the following I have a table with checkbox, I click on several to be sent with a file that you select, by clicking on the button to upload file to each user that you select in the view . This is the controller's method...
asked by 22.11.2018 / 18:48
0
answers

Get some fields to create a subquery bringing, details of an object and the indexes it has in SQL SERVER?

I'm doing a query in SQL SERVER. I need to know the object, type object, size of the object, indexes that have that object and the percentage of fragmentation of each index. My doubt lies in the tables to be able to bring the fragmentation of...
asked by 01.12.2018 / 05:25
4
answers

SQL - Query max value of a group by three columns

What I'm trying to do is that the query returns me from the value of the numberPurpose column of a data group in the SequentialGarantia column, but depending on the maximum value of > Initial debt . Desired result: What I did...
asked by 21.11.2018 / 18:00
0
answers

Error trying to make custom queries to Mysql database

I have a table in HTML where the information I have stored in a table of my Mysql database is displayed and this information is consulted through ajax. At first I had a code that extracted and showed all the data without having any search option...
asked by 19.11.2018 / 02:13
1
answer

Relationships in my database

I have a doubt as to which 3 tables would do practically the same, Save the urls of where the files are located I have a table called Groups - where you can save files, in general it's just uploading files. And already in their respective gro...
asked by 20.11.2018 / 04:04