Questions tagged as 'sql'

1
answer

Escaping PHP quotes

I'm doing a insert in sql and I needed to change the single quotes, because for example a name O'Connor breaks the structure. I've tried putting: str_replace("'", "\'", $cadena); Also with: htmlspecialchars($contenido->te...
asked by 01.10.2018 / 16:18
2
answers

Encrypt password 50 characters in VARBINARY (8000)

If I encrypt a 50-character password in a VARBINARY(8000) field, does it occupy some extra space when being 8000 length? Or is it how VARCHAR ?     
asked by 09.06.2017 / 17:40
2
answers

What does the use of (+) mean in an Oracle query? [duplicate]

I would like to know the use of the operator (+) in the following query and what is its possible equivalence in MySQL. SELECT 'E' tipo_envase, DECODE(NVL(pasi_parametro1,'-'),'-','CRE','CON') tipo_pago, vaca_serie, vaca_numero, vaca_l...
asked by 04.10.2016 / 00:05
1
answer

Statement in sql for a datetime

I have this fragment of cogigo public List<byte[]> selectAlarmas1(int numero) { try { cn = new SqlConnection("Data Source = PRUEBA; Initial Catalog = FUCS; Persist Security Info = True; Use...
asked by 17.10.2016 / 22:05
2
answers

JOINS with chains delimited by commas

I have a table called USERS, which has an index of certain nationalities as a string delimited by commas. ID | NOMBRE | NACIONALIDAD 1 | JUAN | 1,2,3 2 | PEDRO | 1,2 3 | JOSE | 1,3 I have my table of NATIONALITIES ID | NACION 1 |...
asked by 02.07.2018 / 22:01
3
answers

Convert VARCHAR to DATE in a SELECT

I have a table whose record has a date, but this date is saved as VARCHAR , I was told that I could convert it to DATE in SELECT . This is what I have: SELECT * FROM tabla WHERE CONVERT (date(15), fecha, 103) = '1/01/2017';...
asked by 15.11.2017 / 16:22
2
answers

MySQL returns "# 1054 - The column 'person.type' in on clause is unknown"

I have this sentence: SELECT registro_vehiculo.fecha_entrada, persona.nombre,tipo_servicio.tipo_servicio FROM registro_vehiculo,persona,tipo_servicio INNER JOIN tipo_persona ON tipo_persona.id_tipop=persona.tipo WHERE registro_vehiculo.fech...
asked by 08.06.2017 / 14:59
2
answers

Chinese characters are not printed when connecting to sql from java

I'm doing a function that all it does is print all the values of a field in a table, however I have Chinese letters saved in the database, and from sql server they look good, but when printed in java it shows only question marks, this is my func...
asked by 30.01.2018 / 21:32
4
answers

Inner join query to display the name with the id in two PHP tables

I have two tables, one call articulos , and another call categorias . In table articulos a column called id_categoria saves the ID of the categories available in the table categorias , and I want to show by the...
asked by 20.12.2018 / 04:11
3
answers

Query with LEFT JOIN and LIMIT 1 in the JOIN does not work for me

I have the following 2 tables order and tracking . The structures are the following: Order ( columns and data ): id fecha nroorder description 1 2017-22-01 1000001 Order1 2 2017-22-01 1000002 Order2 3 2017-2...
asked by 24.01.2017 / 21:20