Questions tagged as 'sql'

1
answer

Name table resulting from SELECT

I need to do a SELECT of the resulting table from another SELECT , but I need to reference it in ON INNER JOIN in>. How do I do this in Oracle (PL / SQL)? I tried this way, but it did not work: SELECT * FROM (SELECT * FROM recurso WHERE...
asked by 22.11.2017 / 14:53
2
answers

Decreasing the value of two fields of a table and sorting according to the result

I have the field "killed" and "died" in the table, I need to make the order of the results come according to the decrease of these two values, My query looks like this: $woes = DB::table('woeplayerrank as woe') ->join('char', 'woe...
asked by 23.10.2017 / 21:20
1
answer

Procedure price range

I'm trying to create a procedure that, depending on the price range, takes a different field from the table. Create Procedure BuscaPreco @preco decimal, @faixa1 int, @faixa2 int, @faixa3 int, @faixa1=100, @faixa2=200, @faixa3=300 Select case...
asked by 24.10.2017 / 16:15
1
answer

How to use aliases in queries using Aliases along with MySQL?

I would like to be able to use the 'AS' alias along with mysql without having to do query alignment, ie I want secondary queries to be named so that I can use them in the main query, For example, in the case below the AS is used nested...
asked by 01.12.2017 / 17:04
1
answer

Error executing function SQL Server

I have a database test today and I'm practicing functions with old exercises only that I'm getting an error when I run the function. tables set language brazilian; CREATE TABLE pedido ( nr_pedido numeric(5) NOT NULL, dt_pedido date,...
asked by 30.11.2017 / 19:39
1
answer

Selection Using FROM TABLE

I have a table and a function that returns a pipeline, but the function needs to receive a data from the first table, I thought the selection would look something like this: Select FERRAMENTA.IDFERRAMENTAS FROM SIG_SERVICOSFERRAMENTAS FERRAME...
asked by 23.10.2017 / 14:59
1
answer

Table is not generated in Oracle database

This normal wheel: create table M_VENDEDORES ( ID_VENDEDOR number (10,0) not null, NOME varchar2 (100) not null, CPF number (11,0) not null, ENDERECO varchar2 (100) not null, NUMERO varchar2 (10) not null, CEP number (11,0) not null, constrain...
asked by 23.10.2017 / 00:32
2
answers

Error in trigger - MySql

I created the following trigger, but it has a syntax error that I can not find. The error is as follows    ERROR 1064 (42000): You have an error in your SQL syntax; check the   manual that corresponds to your MariaDB server version for the...
asked by 13.11.2017 / 20:18
1
answer

How to leave the values in the report with iReport (or TIBCO) only with 2 decimal places

I wanted to make my values in Reals, only 2 decimal places in my report, but I do not know where to declare it. In my application I declare all type floa     
asked by 04.11.2017 / 13:18