- Forum
- Databases
- Oracle I want to retreive only first record from the specified table
-
Junior Member
I want to retreive only first record from the specified table
In the Oracle DB some records are there, now i want to retreive only first record from the specified table without using WHERE clause. How to write the query for this?
-
Re: I want to retreive only first record from the specified table
Specific record without using WHERE clause ?
You should know what is the use of the clause first. That is used to specify the condition.
-
Contributing Member
Re: I want to retreive only first record from the specified table
-
Junior Member
Re: I want to retreive only first record from the specified table
in agreement with moderator. only with the help of where clause we can restrict the rows how come without using it. still if somehow u get a way out of it do let me know .
all the best
-
Re: I want to retreive only first record from the specified table
-
Contributing Member
Re: I want to retreive only first record from the specified table
You can get first record without where clause in SQL Server and MYSQL but not in oracle
SQL Server : SELECT TOP 1 column FROM table
Oracle : SELECT column FROM table where ROWNUM = 1
mysql : SELECT column FROM table LIMIT 1
-
Re: I want to retreive only first record from the specified table
I also know that , but the question was posted in ORACLE section.
-
Junior Member
Re: I want to retreive only first record from the specified table
This a for a general employee table but this will not giv right result if the employeeid has a null value...
------------------------------------------------------------------
Select * from employees start
with employee_id=100
connect by prior employee_id is null
-------------------------------------------------------------------
try modifying the code with respect to ur table
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules