Questions tagged as 'sql'

1
answer

Avoid inserting into a table using PHP / SQL if this record already exists

When I precede in my " Submit " I execute an insert " Insert " that saves a series of records " X[i+] ": id,_Nombre,__fecha a id,_Nombre,__fecha 1__Juan_____22/12/2000 2__Fulano___22/12/2000 3__Aldo_____22/12/2000 I wish that if...
asked by 19.07.2018 / 15:13
1
answer

ERROR when Creating Table

I have the following Script. USE [PS_GameData] GO /****** Object: Table [dbo].[Guilds] Script Date: 07/24/2018 17:33:22 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Guilds]( [R...
asked by 24.07.2018 / 21:58
1
answer

Encode64 in Oracle?

How do I do an encode64 to a query? This is my query select id_solicitud from sol_solicitud where id_solicitud=506 My query brings me 506, but I need the query to return me with encode64, that is to say that it appears like this NTA2...
asked by 25.07.2018 / 12:32
2
answers

SQL Select inner join

I have this problem that according to me I made a query to get only one answer row, but for some reason I get the same record several times, can someone tell me what I'm doing wrong? select [Nombre de Obra], Estado = case...
asked by 17.10.2018 / 18:02
2
answers

Select non-NULL records within a CASE

You can help me with the following, I currently have a query from a table sql-server which brings me the records depending on a condition in WHERE and classifies those records into 4 categories which are' Contrato ',' Otrosies...
asked by 13.08.2018 / 13:57
1
answer

Pass value from a select to modal select

Good I'm doing a form edition through modal. I have managed to pass all the necessary data through javascript, but I do not know how to pass the value of a select to the modal's selection. The select is the state of Activated, Deactivated, an...
asked by 15.08.2018 / 19:58
3
answers

Query with inner join and LIKE operator

I have the following tables with their respective data Table1 +----------+------------+ | IdTabla1 | Velocidad1 | +----------+------------+ | 1 | 123.51 | | 2 | 123.55 | | 3 | 125.23 | | 4 | 125.87...
asked by 11.08.2018 / 08:05
1
answer

SQL duplicate management

It turns out that I have to make a query in which I get returned several duplicate records, except for a field that is counters. The question in itself is that I need to collect the record with the highest value of counters. Right now the sen...
asked by 07.05.2018 / 10:47
2
answers

Count number of SQL records in the same field

It is possible to count how many records there are in a query, I want them to appear as one more column since the query should throw a single row. SELECT dep.nombre as departamento, sum(cap.total_mosquitos) as total_mosquito...
asked by 04.05.2018 / 15:06
1
answer

What can be done to simulate a MS SQL try catch but in PostgreSQL?

What can be done to simulate a Microsoft SQL Server try catch but in PostgreSQL? BEGIN TRY BEGIN TRANSACTION IF EXISTS (SELECT * FROM USUARIOS WHERE ID_USUARIO = @ID_RESPONSABLE) BEGIN DECLARE @ID_CLIE...
asked by 20.04.2018 / 21:43