Questions tagged as 'sql'

1
answer

How can I execute the following query?

I want to be able to get the name of the months by extracting the month from a field that is called FECHA_RECIBE but in the MySql console it tells me that there is an error near FROM . the rest of the query works correctly. The quer...
asked by 05.01.2018 / 22:07
2
answers

perform query with a condition in mysql

I have a person table and a session and in the session table I have the category column, so I want make a query that ignores people who are admin I have tried these codes and I have not obtained the result I want. create procedure li...
asked by 12.03.2018 / 02:53
1
answer

Convert from RTF to Plain Text in SQL Server

I have a column in sql, where from an application I save data in rtf format, I would like to pass it to xml to use in a webservices. Is there any way to achieve this? Here's the example rtf: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttb...
asked by 29.01.2018 / 21:02
3
answers

Duplicate records except one column

Good morning everyone, I'm trying to duplicate these 3 records to another user This is the code that gets the result of the image. CREATE TABLE #TEMP (IDSOL INT not null PRIMARY KEY ,USUARIO VARCHAR(50) ,LastName varchar(255) NOT NULL...
asked by 25.01.2018 / 18:47
2
answers

Why is the result added twice when using SUM () with JOIN?

Hi, I have the following question and it is that the sum is doubled and I do not know why, it adds twice the result when using SUM() with JOIN in Mysql. Each result comes out double in INVERSION_VALOR comes out 492 instead of 246,...
asked by 05.11.2018 / 23:15
2
answers

I need help with a sql statement

You see, I am carrying out a project little by little and I have found a doubt that requires knowledge of sql and the truth is that I know the basics ... I need an ajax request to make me a select that returns the fields of 2 tables, but one...
asked by 29.04.2018 / 14:34
1
answer

Problem in mysql count php, it works in phpmyadmin and not in php

I have this function that should bring me the account of the records in my database on my page: function cuentaticketspendienteempleado($conexion,$id){ $pendientes = mysqli_query($conexion, "SELECT COUNT(t.id) as contador_tickets, t.id as...
asked by 25.04.2018 / 17:35
2
answers

Search in a range of ip's, PostgreSQL

I'm doing a query to get ip addresses given a range, for example: Obtain the ip's that are between 192.168.0.0 and 192.168.0.255 The query I'm using is: SELECT dir_ip FROM nic WHERE dir_ip BETWEEN '192.168.0.0' AND '192.168.0.255' ORDER...
asked by 03.08.2016 / 22:27
1
answer

Count records in MySQL

I am working with MySQL and I need to make a query about the following table called tbl-reserva that has the following structure: id fecha_inicio fecha_fin descripcion The idea is to make a query t...
asked by 06.06.2017 / 04:35
3
answers

How to join 3 queries in sql?

How can I show the following 3 queries in a single selection? select Top 1 NumOperador, Rendimiento, SdFecha from trfRendimientos where (NumOperador = @NumOperador OR @NumOperador = 0) and (MONTH(SdFecha)= month(@FechaDesde) and YEAR(SdFec...
asked by 20.07.2017 / 17:02