Results 1 to 8 of 8

Thread: I want to retreive only first record from the specified table

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Answers
    1

    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?


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    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.


  3. #3
    Contributing Member
    Join Date
    Apr 2006
    Answers
    46

    Re: I want to retreive only first record from the specified table

    nice joke sir.


  4. #4
    Junior Member
    Join Date
    Feb 2007
    Answers
    26

    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


  5. #5
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: I want to retreive only first record from the specified table

    ohh sure , why not.


  6. #6
    Contributing Member
    Join Date
    Jun 2006
    Answers
    95

    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


  7. #7
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: I want to retreive only first record from the specified table

    I also know that , but the question was posted in ORACLE section.


  8. #8
    Junior Member
    Join Date
    Jun 2007
    Answers
    18

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact