Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    74

    Unanswered: Help with EXISTS

    hi guys! is there anyway to retrieve the row from the result of EXISTS function aside from using the code below?

    Code:
    if EXISTS (select * from rcps_useraccount where User_login = 'daimous')
    BEGIN
    	select * from rcps_useraccount where User_login = 'daimous'
    END

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    how about simply this:

    select * from rcps_useraccount where User_login = 'daimous'

    ??

  3. #3
    Join Date
    Sep 2005
    Posts
    74
    hehehe...actually that what im thinking..But Im just curious in using EXISTS...Anyway, thanks for that..

  4. #4
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    reminds me of this kind of thing that you'll see rookies do in C/C++/C# sometimes:

    Code:
    if (myBool) 
    {
       return true;
    }
    else 
    {
       return false;
    }
    when they could just do this:

    return myBool;


Posting Permissions

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