RETURNS LINE SPECIFIES

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Fri, 18 May 2007 11:46 am

Anyone know how I do a select to return a row specifies the table?? As if it were a rownum but I want only one line ...
luis_rafael
Location: RJ

Poston Fri, 18 May 2007 1:21 pm

To get the x line of the table, you have to use a SUB SELECT.
Example: Taking the fifth
Code: Select all
select *
from
  (select a.*, rownum numero
  from sua_tabela a
  where ...
  order by ...
  )
where numero = 5
:-

Is that what you want?
Last edited by dr_gori on Fri, 18 May 2007 3:42 pm, edited 1 time in total.
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered

Poston Fri, 18 May 2007 2:41 pm

That's not exactly what I wanted ... I was wondering if there is any command that returns only one row..
for example: select * from table where rownum = 10;

This example is rownum, in which case it will return 1 to 10 lines.
q I want to know is whether there is any other command like the rownum but that returns not several but only 1 line.
luis_rafael
Location: RJ

Poston Fri, 18 May 2007 3:48 pm

If you put WHERE ROWNUM = 5 returns nothing.
Will return if put ROWNUM < = 5 returns the 5.

To return only 1, place WHERE ROWNUM = 1 is that?
dr_gori
Location: Portland, OR USA

Thomas F. G

Você já respondeu a dúvida de alguém hoje?
http://glufke.net/oracle/search.php?search_id=unanswered

Poston Mon, 21 May 2007 7:59 am

Returns the first 5 lines then you can control it through an application.

I had this problem too, to resolve I created an application to return the ID, I plugged in through a socket.

Hugs
LoadingXp
Location: SP

Att.

Luciano Alvarenga M. Pires
DBA ORACLE CERTIFICADO
http://fulloracle.blogspot.com
------------------------------------
Dinheiro é o combustivel da sociedade industrial. Mas na sociedade da informática o combustivel, o poder, é o conhecimento.

Poston Mon, 21 May 2007 8:19 am

You couldn't get the PK of this table, brother?
You do not know specifically the line that you want to return?
Maybe a ROWID help, if the PK don't work.
Trevisolli
Location: Araraquara - SP

Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP



Return to SQL

Who is online

Users browsing this forum: No registered users and 3 guests