Questions tagged as 'sql'

2
answers

Does the order of conditions in a WHERE change the efficiency of the query?

If I have a query of the type: SELECT a, b FROM c WHERE a = 5 and b LIKE '%foo%' And I have another: SELECT a, b FROM c WHERE b LIKE '%foo%' and a = 5 I have executed both and both have the same execution time, but as for the consumpti...
asked by 27.06.2017 / 23:24
2
answers

Retrieve total of items from combinations

I have the following table in a PostgreSQL database: CREATE TABLE combinaciones ( id serial NOT NULL, valor character varying NOT NULL, CONSTRAINT id_pk PRIMARY KEY (id) ) WITH (OIDS=FALSE); ALTER TABLE combinaciones OWNER TO post...
asked by 13.06.2018 / 02:04
1
answer

Jquery Ajax Post (onchange infinite loop)

Good people I have the following problem: I have a dropdownList that depending on its value brings me by ajax a different form with its respective button, until there works well. <div id="contformularios1"> </di...
asked by 27.01.2016 / 15:49
2
answers

Validate a user within the database

Good morning, I am working as Windows Forms and user controls within C #, which I am working with an application that acts as a clock watch. This first screen acts, like the main screen. Which all users have access to now. Inside...
asked by 28.08.2018 / 00:17
2
answers

Iterative query with permissions

I have two tables jerarquia and permisos , where hierarchy has an ID, a ID_PADRE (pointing to the same table to a parent node) and a DESCRIPTION of the node itself. The permissions table has an ID_OPERATOR (id of the user that is lo...
asked by 04.08.2017 / 16:14
4
answers

Select two columns with the same name from two different tables

If I have two tables that have a column called direccion , and I want to take only one of them as I do?    Client table: ID, address, level, mail, password, name       Company table: EID, address, name What I want to do is: SELEC...
asked by 12.01.2017 / 17:13
1
answer

sql when using nolock

In a query made with two tables, there is the possibility of placing a nolock. Why is this done? FROM tabla1 t1 (nolock) INNER JOIN tabla2 t2     
asked by 18.06.2016 / 16:36
3
answers

Casting of numbers with decimal point

Good morning to all of you, today I am trying to round a value of FLOAT to two decimals but doing so by consulting SQL SERVER shown below, some values rounded me correctly and others not, example: 19.1 I rounded to 19.10 already with t...
asked by 30.11.2016 / 16:34
4
answers

How to make a query WHERE NOT EXIST after an INSERT in SQL

I have problems with the following query: INSERT INTO 'pasajeros' ( 'nombre','apellidos','email','password','telefono') VALUES ('Alexandra','Gonzalez','[email protected]','1234567!','04242344556' ) WHERE NOT EXISTS ( SELECT * FROM 'transportista...
asked by 16.03.2017 / 21:04
5
answers

How to delete all records from a SQLServer table?

I need to delete all the records of a SQLServer table without indicating which one I want to delete, I want them to be all and this code deletes data in specific delete from tbl_usuarios where nombre='Abi';     
asked by 19.04.2017 / 17:58