-1
Good afternoon!
Can someone help me? I need to bring the data of a query (query) with the return as below, regardless of the order of the numbers are. I have a table of metrics, and this query is according to these metrics, and may be out of order. When I run the query, it always returns ordering. And I don’t want it this way, I need it to return as in the small example ( Need). And my query, will bring more than 100 columns,and these numbers may be random, but will follow as my select. The number 100 will always be the last.
Following example:
SELECT (codigo, Valor> BULK COLLECT INTO teste FROM tb_teste
(
select 1, 'Valor Produto' from dual
union all
select 2, 'Qtde Produto' from dual
union all
select 98, 'Descrição Produto' from dual
union all
select 101,'Qtde Vendas' from dual
union all
select 50, 'Qtde em Estoque' from dual
union all
select 97, 'Qtde Pedida' from dual
union all
select 100, 'Qtde a Entregar' from dual
)
Resultado:
+----+-----------------------+
| cd | valor |
+----+-----------------------+
| 1 | Valor Produto |
| 2 | Qtde Produto |
| 98 | Descrição Produto |
|101 | Qtde Vendas |
|100 | Qtde em Estoque |
+----+-----------------------+
This will come from a table or this mount via 'dual' !? I would create either an order column (not displayed) or a 1-Value type artifice ... 2-Qtde ...
– Motta
Thanks for the return. Turns from a table, the Union all will exist... How do I make this column of order ( not displayed) or artificially type 1?
– Cristine Dias