Results 1 to 20 of 20

Thread: [Nasulbad] Select

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    [Nasulbad] Select

    Please don't move.

    How can I select from a table where a certain value is on the top. Or something like the first result.

    root
    AnotherName
    BEER
    CCC
    ZZZ

    You should see the sample. Sorted by Asc but the root is on the top list. How do I select something like that. Thank you.
    Last edited by nebulom; Mar 5th, 2005 at 05:31 AM.

  2. #2
    New Member OrdinaryFrog's Avatar
    Join Date
    Oct 2002
    Posts
    5

    Re: Select

    Quote Originally Posted by nebulom
    Thank you.
    you're welcome

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: Select

    Any other comments? Thank you.

  4. #4
    New Member OrdinaryFrog's Avatar
    Join Date
    Oct 2002
    Posts
    5

    Re: Select

    Quote Originally Posted by nebulom
    Thank you.
    I already said you're welcome, why do you insist

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: Select


  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: Select

    Thanks

  7. #7
    Banned timeshifter's Avatar
    Join Date
    Mar 2004
    Location
    at my desk
    Posts
    2,465

    Re: [Solved] Select

    you're very welcome.

  8. #8
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Re: [Solved] Select

    Quote Originally Posted by timeshifter
    you're very welcome.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: [Solved] Select

    You guys really think I thank you?

    Just an expression but never it came from my very self. Poor.

    Now I sounded rude.

  10. #10
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: [Solved] Select

    Case sensitive "r" before "A"

  11. #11

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: [Solved] Select

    Say I have it on my database, Dave. Also there is a username with "a" but still I want the root to be the first result. Idea? Thanks.

  12. #12
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: [Solved] Select

    Quote Originally Posted by nebulom
    Please don't move.

    How can I select from a table where a certain value is on the top. Or something like the first result.

    root
    AnotherName
    BEER
    CCC
    ZZZ

    You should see the sample. Sorted by Asc but the root is on the top list. How do I select something like that. Thank you.
    Assuming that your column is called user_name:
    Code:
    SELECT use_rname, LCASE(user_name) sorted
        FROM table_name ORDER BY sorted;
    Assuming MS SQL has a function called LCASE()
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  13. #13
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: [Solved] Select

    VA, Are you hiding?

  14. #14

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: [Solved] Select

    Attached Images Attached Images  

  15. #15
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: [Solved] Select

    Quote Originally Posted by nebulom
    I think I don't understand your question
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  16. #16
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: [Solved] Select

    I think he has to do 2 selects. One to get the root out, and then one to get the rest sorted.



    ØØ

  17. #17

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: [Solved] Select

    I want the root user to be the first result. Just the root.

    root
    anotheruser
    otheruser
    someuser

    after the result (which the root first come out (should)), records are then sorted by asc, alphabetically. NotKLH is right putting a whitespace or a special character on the root user but the root has to enter [special character]root on the login form.

  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: [Solved] Select

    Quote Originally Posted by NoteMe
    I think he has to do 2 selects. One to get the root out, and then one to get the rest sorted.



    ØØ
    Yeah. I think I'll have to do it this way.

    Or... I have a date column and set 1/1/01 for root and select order by date.

  19. #19
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: [Solved] Select

    Quote Originally Posted by nebulom
    I want the root user to be the first result. Just the root.

    root
    anotheruser
    otheruser
    someuser

    after the result (which the root first come out (should)), records are then sorted by asc, alphabetically. NotKLH is right putting a whitespace or a special character on the root user but the root has to enter [special character]root on the login form.
    Ahhh, well make an extra column called importance. Give root an importance of 0 and everything else an importance of 1 and use this query:
    Code:
    SELECT username, importance
        FROM [user]
        ORDER BY importance, username;
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  20. #20

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    Re: [Solved] Select

    Usa ka sa mga maayo nga mga programmer nga akong nahimamat. Salamat.

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