Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    Posts
    18

    Unanswered: What does it means ?

    Hi,
    I know that (+) is used in outer joins to include the row as null if there is no matching record. But I find - (minus) operator also. Could someone tell me what it is used for ? Is the opposite of the (+) used for outer join ?

    ( I was executing my code after commenting using -- . I removed the comments and found no results. I found that the comment was not removed properly; I removed only one of - instead both. The query works fine but I would like to know what is the use of '-' operator.)

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: What does it means ?

    The minus sign "-" means only one thing - subtract second value from first. I guess it depends on exactly where in your syntax it occured. For instance here:

    SQL> select * from emp
    2 where ename like '%' and -
    3* deptno > 0
    4 /

    no rows selected

    This works, because the "-" is associated with deptno, i.e.

    and -deptno > 0

    But here:

    SQL> select * from emp
    2 where ename like '%' -
    3 and deptno > 0
    4 /
    and deptno > 0
    *
    ERROR at line 3:
    ORA-00936: missing expression

    This fails because -and doesn't make sense.

Posting Permissions

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