Questions tagged as 'sql'

2
answers

query prepared in php does not work (no error)

I'm trying to execute this query but it does not give me any errors but it does not work for me, it simply does not order anything: $sql = 'SELECT * FROM productos ORDER BY :orden'; $stmt = $this->BD->prepare($sql); $params = array(':ord...
asked by 15.11.2016 / 15:17
2
answers

How to select 1 date field with 3 tags in Oracle SQL?

I'm doing query in oracle 11g and they ask me to select the last 3 dates when a client paid invoice. The query I have it like this: SELECT t1.datefield date_1, t1.datefield date_2, t1.datefield date_3 FROM ta...
asked by 28.10.2016 / 15:52
3
answers

Make Select in all columns except in 2 specific [duplicate]

I have the colunnas mapa, numero, mob1, mob2, mob3, mob4 asi hasta el mob400 In sql I want to do something like say this SELECT * NOT IN(Mapa, numero) FROM Tabla WHERE mapa = 1 can it be done that only the columns are not shown witho...
asked by 16.11.2016 / 02:48
2
answers

CREATE DATABASE permission denied in database 'master'

Good afternoon everyone. I'm having trouble creating a database. Since I get the error    CREATE DATABASE permission denied in database 'master' Since the SuperUser (sa) I have given permission to the user "Lucas" with db_owner so he can...
asked by 02.11.2016 / 20:45
2
answers

Get records between two DATETIME in SQL Server

I need to get the available records between two DATETIME columns in SQL Server, so that one column is the beginning and the other the end. That is, when making a query based on both values, get the data that are in the range of the DATET...
asked by 08.12.2016 / 06:16
1
answer

SQL Server Syntax to Oracle [Create User]

Hello, I was looking for how to change this syntax from sql server to oracle and I still do not understand the structure that oracle has in its bd. The sql server syntax: USE [BD] GO /****** Object: User [pepe] Script Date: 06/05/2017 1...
asked by 05.06.2017 / 17:08
1
answer

Put the result of an sql query in a variable with PHP PDO [closed]

<?php try { $nombre=$_GET["nombre"]; $password=$_GET["pass"]; $base=new PDO ("mysql:host=localhost; dbname=te_la_juegas","root", ""); $base->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); $sql="select...
asked by 02.06.2017 / 20:01
1
answer

group the results of a query in a single row

I have a view in sqlServer in which I do the following select SELECT mes ,P117_Dias_Trabajados ,P004_Dias_Falta ,P002_Dias_Permisos_CG ,P003_Dias_Permisos_SG ,P003_Dias_Licenicas_Comun ,P003_Dias_Licencias_L...
asked by 28.11.2017 / 13:53
2
answers

Result Set empty with Prepared Statement in java against Oracle

Good! I have the following code that is not returning any data to the ResultSet defined: Connection _con = null; PreparedStatement _ps = null; ResultSet _rs = null; UsuarioBean _Ret = null; _con = (new ConEvaluacionProveedores()).ge...
asked by 05.06.2017 / 16:31
1
answer

Do I need to create the models for the tables in the database? Laravel 5.1

I came up with the following doubt, in a project that I am doing I have about 25 tables for my database. My .sql file is already ready with the tables and I want to know if I have to create a model in Laravel for each table, I want to know becau...
asked by 08.10.2016 / 05:17