Questions tagged as 'sql'

1
answer

function year (date) does not exist

I have the following query in mysql runs fine, but in postgres I mark error in YEAR (dias_festivos.fecha) = '2000', says:    function year (date) does not exist Does anyone know why? This is the query: SELECT dias_festivos.id, dias_f...
asked by 16.12.2017 / 21:04
1
answer

What is the correct syntax of a select in SQL SERVER (alias)?

What is the correct syntax in a select using SQL SERVER? SELECT columna FROM [basedatos].dbo.tabla AS tb WHERE condiciones O SELECT columna FROM basedatos.dbo.tabla tb WHERE condiciones Can you use aliases? Are brack...
asked by 23.01.2018 / 09:36
1
answer

Average of each MySQL car

I have the following table in MySQL create table alquilan ( matricula varchar(20) not null, id_usuario numeric not null, n_tarjeta varchar(50) not null, codigo_seguridad varchar(10) not null, precio numeric not null, ch...
asked by 22.12.2017 / 19:33
1
answer

Adding time in MySQL

I'm trying to add a certain time to another. For example: I have the time: 23:00:00 (11) and I want to add 2 hours (that of 01:00:00) but I do not achieve it. I tried ADDTIME ("23:00:00", "02:00:00") but this returns me 25? How could you s...
asked by 09.12.2017 / 00:06
1
answer

How to read a JSON that is sent from a webservice on Android?

Hi, I have a php file in a hosting, this file consults and returns the data through a JSONArray. $idusu=$_GET['pkusu']; $pass=$_GET['passw']; if($_GET['opc']=="1") { $sql="consulta..."; $r2=mysql_query($sql) or die(mysql_error()); i...
asked by 09.12.2017 / 03:03
1
answer

Delete Duplicate records in sql server [duplicated]

I have the following Query with which I get the number of times that is repeated every id_turner in my table rol_por_tercero . use DatabaseName select id_tercero,COUNT(*)CantidadRepetidos from rol_por_tercero group by id_tercero havin...
asked by 26.01.2018 / 21:28
1
answer

Update data in sql

I have the following code, I would like to know how to modify it to make an update to the data that I consult from the id_rol_tercero table, the table I want to update is called rol_por_tercero, use NameDatabase SELECT rol_por_tercero.id...
asked by 26.01.2018 / 15:13
1
answer

Mysql Complex Consultation

I want to show in a table how many people belong to a department and their department head, if there are no people, it will show 0, and if there is no department head assigned, any value ("there is not", 0, I do not care) In this selection I...
asked by 02.12.2017 / 23:24
1
answer

Check the records of a field in SQL SERVER 2008

I need to know the number of records a field has in SQL SERVER 2008. If I execute the statement: select count(*) from 'tabla' the result that throws me is 996.561 but if I execute the sentence: select count(e-mail) from 'tabla' the...
asked by 04.12.2017 / 22:57
1
answer

Fatal error: Call to a member function fetch () on a non-object

I am trying to extract the data from a given cabin (it must be a whole number: 1, 2, 3, ... n). Why do you tell me that you have not defined "images" in the Cabanas.php file? I have defined var_dump ($ data); so you can tell me what you get...
asked by 04.12.2017 / 21:45