Questions tagged as 'mysql'

2
answers

how to make an INSERT of several countries

This situation has never occurred to me but there is always a first time. The thing is that I have a field type select and I need to fill it with a list of countries, I already have the list but I have no idea how to do INSERT of this...
asked by 16.09.2018 / 01:26
1
answer

Create index with a substring field

Is it possible to create an index in mysql but the index field is a substring? For example: Create NON-UNIQUE INDEX nombreInidice on nombreTabla (SUBSTRING(nombreCampo FROM 1 FOR 4)) USING HASH;     
asked by 18.11.2016 / 14:45
2
answers

Distinguish accents and non-accents in MySQL and Java

I have created a table in a MySQL database that stores a text field: CREATE TABLE 'Usuarios' ( 'Id' int(11) unsigned NOT NULL AUTO_INCREMENT, 'Nombre' varchar(50) DEFAULT NULL, PRIMARY KEY ('Id') ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAUL...
asked by 23.05.2016 / 21:19
1
answer

Insert a date before the scheduled date

I have a table called deliveries, within it 2 fields fecha_preparar and fecha_entrega . $fecha_prepararse = fecha_entrega - 4 dias INSERT INTO entregas (fecha_entrega, fecha_preparar) VALUES ('$fecha_entrega', '$fecha_prepararse'...
asked by 02.09.2017 / 07:01
1
answer

Display records in a select based on the id of another select

I have a system to sanction administrative personnel. I recently solved the problem that changing a select called article would change the description in a textarea. Now I have the following question: I added to the system the possibi...
asked by 31.01.2017 / 22:06
1
answer

Number records of a query in MySQL (alternative to variables defined by the user)

Inside the MySQL database manager I have a table of which I do a% general% co_ and I want to list with an incremental number all records, I can do it originally with a user defined variable as follows : SET @counter = 0; SELECT (@counter := @...
asked by 20.09.2018 / 17:36
1
answer

fusion sql queries

SELECT Date(f.Fecha),SUM(f.Total) as fac FROM factura f WHERE f.Tipo='Factura' AND f.Fecha BETWEEN '2018-09-20' AND '2018-09-25' GROUP BY Date(f.Fecha); SELECT Date(s.Fecha),SUM(s.Total) as sal FROM sales s WHERE s.Fecha BETWEEN...
asked by 27.09.2018 / 01:23
2
answers

How to import into MySQL database from command line?

I'm trying to import a more or less large database ( 1Gb ) using PHPMyAdmin . The process is too slow and always cuts. Is there a way to import a database MySQL from the command line?     
asked by 27.12.2018 / 15:35
1
answer

Consult MySQL with OR and AND clauses?

I want to list the products that are in two lines and also filter by the description, the table has the following structure: CREATE TABLE productos ( IMA_ARTICULO DOUBLE ,IMA_DESCRIPCION VARCHAR(100) ,IMA_LINEA DOUBLE ,IMA_IMPU...
asked by 11.10.2017 / 23:08
1
answer

Connect to MYSQL server

I am creating a small application to connect to my local MySQL server and make a DATABASES SHOW so I can fill a ComboBox with all the databases there are and based on that, fill in another combo with all the tables of that BD. But when I do t...
asked by 07.04.2018 / 21:10