Questions tagged as 'sql'

2
answers

How can I make a sql that contains an array of objects and that those objects contain 2 column data?

I have this sql The result of the 2 columns modelos_id and modelos_nombre I would like to join within objects, I try to do as it says the documentation . Here's what I'm trying to do , the query is as follows: SE...
asked by 30.04.2017 / 03:55
2
answers

Problem with WHERE in temporary field

I have this query that calculates the distance between 2 points given certain coordinates. The query runs well, the problem is the WHERE of the query, this is the error:    Error Code: 1054. Unknown column 'dist' in 'where clause' If I...
asked by 13.10.2017 / 00:41
2
answers

SQL See DB count

I have a table called decree in the database with the following fields: and I want to see the years that I have in my database in which I have entered data. Example in the database I entered dates in 2016 2017 2018 and the query that shows...
asked by 20.09.2017 / 15:35
1
answer

How to divide fields of a table with SQL?

I have an entity or database table with records like the following: I am aware that the entity needs database normalization but at the moment I only have read permissions and I am not allowed to make modifications of this type, which wo...
asked by 03.02.2018 / 01:15
1
answer

Update of multiple rows with different values

I'm trying to update different rows with different values, in my sql table, the closest I've come is: UPDATE cursos SET posicion = 11 where Id in (1,2) But it updates me with the same value (11) logically the two rows, I need to give a...
asked by 30.08.2017 / 01:12
1
answer

Check only the current month

I have an invoice which will be filled in monthly, the records with the date do it correctly at Hora de Caracas/Venezuela , but in the following script it shows the values of example 05/agosto/17 al 05/septiembre/2017 , which would c...
asked by 05.09.2017 / 06:46
1
answer

Transpose columns in SQL with PIVOT?

Someone can easily explain me an example with PIVOT to transpose columns by rows in sql. I have several data represented as follows: FECHA ERROR1 ERROR2 2017-01-01 12 23 And I would like to transpose t...
asked by 17.08.2017 / 09:34
1
answer

Translate from SQL query to Eloquent

Hi, I'm new to eloquent and laravel, I have the following query, which runs perfectly from phpmyadmin: SELECT * FROM vips_categories JOIN vips_products JOIN vip_archivos WHERE vips_categories.parent_id = 1 AND vips_categories.parent_id = vips...
asked by 04.08.2017 / 20:49
2
answers

How to concatenate a String with SQL query in PHP?

I am writing a script in php that makes a query to a sql database. The result of that query I need to concatenate it with a string. Example: the query to the database returns "Cosme Fulanito" and I need to concatenate it with a stri...
asked by 06.08.2017 / 03:17
2
answers

Operator LIKE does not work in my app vb.net

Greetings to all. I have the following problem I have a procedure stored in SQL Server that retrieves data with the like operator, but it does not work for me. create procedure recupera_art @cadena char(40) select * from articulo where clave...
asked by 16.01.2018 / 22:08