Questions tagged as 'sql'

2
answers

How to convert the month of the date to text?

I want my months that are numeric to be displayed in text, but I do not know the correct way to use the datename. Thanks SELECT SUM(AU.Tarifa_Diaria) AS [TOTAL],MONTH (AO.fTermino) AS [MES] FROM Arriendo_Autos AU INNER JOIN Arriendo_Solicitu...
asked by 31.10.2018 / 13:20
2
answers

Trigger so that it does not update the stock when it is 0

Hi, I want to make a trigger that when the stock of my inventory is less than or equal to 0, it does not allow me to sell more product but it still subtracts them anyway. create trigger NoProductos0a on InventarioProducto for update as decla...
asked by 10.05.2018 / 19:05
1
answer

Execute Query Through Editext and Button to SQL Android

I need to know how I can make a query, what kind then a default query that when I say in the edittext of my app, a name of any client the search button will bring me the names of my SQL database for example, these two types of query use...
asked by 07.10.2016 / 21:03
2
answers

convert rows to columns in sql 2012 [closed]

hi how are I have this query SELECT nom_emp, ISNULL (LENTES,0)[LENTE], Fecha_Gestion, ISNULL (AYUDA_ODONTOLOGICA,0)[AYUDA ODONTOLOGICA], Fecha_Gestion FROM (SELECT me.nom_emp,Fecha_Gestion,TB.Tipo_Benef,Monto F...
asked by 07.03.2017 / 16:12
3
answers

Array of native query to Java object

I have a problem when performing a native query, where the result in SQLManager is this: Query: "select p.cod_producto, p.deno_producto, array(SELECT t.cod_tanque FROM estagas.tanqu063 t where t.cod_producto = p.cod_producto) as tanks, array(S...
asked by 27.11.2017 / 12:38
3
answers

Run .sql file from php

I have to make a program in php that executes two files .sql, both will create a table within my database 'form of payments'. The .sql files I already have, I just have to do the program in php. This is the sql file: -- MySQL dump 10.13 Di...
asked by 03.07.2017 / 23:42
4
answers

Filter by dates in sql server

I need to be able to perform a query in which I must filter by dates, in which I have start date and end date and that the query gives me results that are within the range of those two dates     
asked by 11.11.2016 / 23:42
1
answer

How to do the following SQL query?

Hi, I'm starting to work with SQL, I'd appreciate it if you could help me because I have trouble making the next query, I do not know how to do it TABLE employees id INTEGER NOT NULL PRIMARY KEY managerId INTEGER REFERENCES employees(id) na...
asked by 22.02.2018 / 17:38
2
answers

From SQL query to Query in Codeigniter

I have the following query in SQL that works fine SELECT MONTH(NOW()) AS mes, SUM(importe) as monto FROM pago_cliente WHERE MONTH(fecha_del_deposito) = MONTH(NOW()) AND YEAR(fecha_del_deposito) = YEAR(NOW()) GROUP BY 1 And I try to t...
asked by 27.03.2018 / 21:16
3
answers

Cast in postgres operator does not exist: character varying = integer

Greetings, I'm doing an SQL query. The column to which I apply the WHERE condition is of type character varying, but the data with which I complete the condition is an integer. SELECT * FROM tablaCodigo WHERE codigo = 123 Getting the follow...
asked by 01.11.2016 / 17:15