select only two rows in a table
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: select only two rows in a table

  1. #1
    Join Date
    Aug 2000
    Posts
    25

    select only two rows in a table

    I like to select only two rows in a table where there is total five row. How I do that? Also I would like to save the result in text.

    Thanks

  2. #2
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    What 2 rows do you want to select?

    to save the result in text file use:
    Code:
    SQL> spool [filename]
    SQL> ..run query..
    SQL> spool off
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  3. #3
    Join Date
    Aug 2000
    Posts
    25
    Table name is acme. It has five columns. Column a, b, c d and e. I would like to select all from a and d and save the result to a file.

    Many thanks.

  4. #4
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    Do you mean this.....

    Code:
    SQL> spool a_file.txt
    SQL> SELECT a,d FROM acme;
    SQL> spool off
    If you don't then can you explain a bit more, if this is it you need to RTFM
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  5. #5
    Join Date
    Aug 2000
    Posts
    25
    Jovery,

    That is what I was looking for. Thank you for your help.

    Regards.

  6. #6
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Originally posted by Puja
    I like to select only two rows in a table where there is total five row.
    Originally posted by Puja
    It has five columns. Column a, b, c d and e. I would like to select all from a and d and save the result to a file.
    You really must learn the difference between a row and a column.

  7. #7
    Join Date
    Jan 2000
    Location
    Chester, England.
    Posts
    818
    Originally posted by DaPi
    You really must learn the difference between a row and a column.

    You're getting soft chaps.

    It wasn't even in the Developer's forum and you still helped out with only minor sarcasm.

  8. #8
    Join Date
    Jan 2001
    Posts
    3,131
    Originally posted by Puja
    Jovery,

    That is what I was looking for. Thank you for your help.

    Regards.
    He is a genius you know.
    Taught me everything I know.
    I remember when this place was cool.

  9. #9
    Join Date
    Jan 2002
    Location
    Netherlands
    Posts
    1,587
    Database business is is not booming anymore, me thinks...
    Tarry Singh
    I'm a JOLE(JavaOracleLinuxEnthusiast)
    TarryBlogging
    --- Everything was meant to be---

  10. #10
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    Originally posted by Mr.Hanky
    Taught me everything I know.
    Hanky, I ain't taking responsibility for you!
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width