Questions tagged as 'query'

1
answer

Carry out two consultations in the same method in Laravel

In an application made with Laravel, I have the following methods: public function scopeGetCountAndSumCotizacionesByVendedor($query, $ano, $mes) { return $query->select('trabajada_por', DB::raw('COUNT("trabajada_por") as cant_ve...
asked by 06.01.2018 / 02:42
2
answers

mailto body from php

I have this code <table width=100% border="5" align="center" cellpadding="0" cellspacing="1"> <tr> <th width=12% align="center" scope="col">nombre</th> </tr> <tr> <?php $customers = "select *...
asked by 24.08.2017 / 16:34
3
answers

how to transpose columns and hide row?

the code I'm using: select ccc.Descripcion AS Grado, p.CodPersona AS Codigo, p.NombreCompleto AS Nombre, cc.Detalle AS Detalle, SUM(cc.Valor) AS Valor from Cuenta cc inner join AlumnoDB.dbo.Alumno a on cc.IdAlumn...
asked by 25.09.2017 / 14:49
1
answer

Use subqueries or joins? Alternatives to left | right join? [duplicate]

Good morning. My Doubt is: Which is better in terms of readability and performance, use subqueries whenever possible or use the "join" format? What is more important, readability or performance? I would understand that many would say that if t...
asked by 14.07.2017 / 22:17
1
answer

SQL close date

Along with saying hello and thanks for this space, I ask for help with the following. I have two tables .. the table1. is a historical sales record with the fields fecha_vta, código_producto, cantidad. in the other table I have the variation of...
asked by 05.12.2018 / 16:01
1
answer

Replace values of one table in relation to another?

Good afternoon group my query is the following I have these tables In the table books is the field lib_autor this field has a lot of records 3689 to be exact each one with its respective author (but these are repeated) and what I want is t...
asked by 08.09.2018 / 23:22
1
answer

Query with dates using a range

I have the following query: query=Detalles.objects.filter(fecha_creacion__range=(fecha_inicio,fecha_final)) The expected result is to filter the results between date A and date B, that is: fechaA= 01-07-2018 FechaB=04-07-2018 However,...
asked by 04.07.2018 / 20:40
1
answer

because this error: Creating bean whith name NameRepository, No property parameters found for type?

I have the following service public List<Factura> listFactura(String campo1, String campo2, String Campo3); and its implementation @Autowired private FacturaRepository repository; public List<Factura> listFactura(Str...
asked by 05.06.2018 / 04:08
1
answer

Applying Django mixins and queries with Q objects - particular behavior

I have the following mixin in which I want to recover the data from the User model with which I work to place this data in different views based on classes that I am developing: class UserProfileDataMixin(object): def get_context_da...
asked by 10.06.2018 / 06:23
1
answer

Show query in table

I have my functional sql query. If I print it with print_r it gives me all the information I need, which are only 5 records with 3 data: Array ( [0] => stdClass Object ( [fecha_del_deposito] => 2018-05-08 [importe] => 60 [tipo_...
asked by 10.05.2018 / 21:28