Questions tagged as 'sql'

1
answer

Get the number of rows of an SQL query

I have a problem in a query, in this query I have the students enrolled in a section of a specific year and their averages. My goal is how I can get the number of students who pulled at least one course in that year. select N.Descripcion as Ni...
asked by 18.10.2018 / 01:22
1
answer

Optimize SQL query using Eloquent de Laravel

I hope you're all right, I have the following query on my system. public function visits() { foreach ($this->countrys as $country) { $query = Visit::where('country',$country)->count(); $visits[$country]=$quer...
asked by 08.10.2018 / 02:07
1
answer

SQL Server - Bring extra data with a Group By

I have a table with different terminals. In it, the terminal number and its different measurements are recorded every 15 minutes (that is, the terminal number will be repeated many times in the table, but each record with a different date). Exam...
asked by 19.09.2018 / 15:55
1
answer

how do I do this query in Eloquent

How can I make this query in Eloquent? select count(id) as NumeroPreguntas, user_id from preguntas group by user_id order by NumeroPreguntas DESC Limit 10; I tried pregunta::groupBy('categoria_id')->get()...
asked by 03.11.2018 / 00:06
1
answer

How to create invisible columns in MariaDB?

Inside the database manager mariaDB, we can create a table, indicate the type of data we expect to receive, as well as its longitud and whether it should be NULL .    However, in managers such as Oracle we can define in th...
asked by 18.09.2018 / 03:55
3
answers

Limit content according to user

I have a question about how to limit the options that a user sees in a form in my select / option I want the user id = 1 to only see the clients that I assign (let's say the client1 and clients5) I am free to add fields for this purpose in my...
asked by 06.09.2018 / 17:11
2
answers

Problem in MySQL Select query

I have a problem in a Query in MySQL, I currently have two tables, one of employees and one of places visited by that employee by date, the goal is to obtain through a query the list of all employees and the last place they visited, so far so go...
asked by 05.09.2018 / 20:17
1
answer

Split in SQL of a select

Hello friends, I have a very simple query, let's say it is select puesto from puestos and give me back the following | 1 | Oficial Policiaco | | 2 | Juez Amparo | | 3 | etc etc | I need to separate this select and accommodate somethi...
asked by 01.11.2018 / 23:47
2
answers

Problem with SQL query and Group By

I have the following query that I do in SQL Server select distinct f200_razon_social, f200_nit, f253_id AS Numero_auxiliar, f253_descripcion AS Auxiliar, SUM(f353_total_db - f353_total_cr) as TOTAL from t350_co_docto_contable INNER JOIN t200_...
asked by 06.09.2018 / 19:09
1
answer

Add in a Mysqli a value different from that indicated by the select

guys I have the following conflict: I have the following code line in a form: <div class="form-group"> <label for="monto">Seleccione Monto</label> <select class="custom-select" id="monto_mensualidad" name="monto_mensual...
asked by 10.09.2018 / 20:11