Results 1 to 4 of 4

Thread: Conditional operators in Oracle queries

  1. #1
    Join Date
    May 2009
    Posts
    1,070

    Conditional operators in Oracle queries

    I want to know about the SQL queries and What is the process to fire it on database and If we want to access selected data that can fit according to my need. What are the types of operators that can be used in the queries of Oracle database. I wanted to know specially about ANY and ALL operator with their syntax and explanation. Can you help me please..

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Conditional operators in Oracle queries

    An operator takes some arguments and after manipulation, it returns a result. Operators are indicated by some special characters or keywords.

    There are so many operators are being used to fetch the data from database.They are categorized into different segments :

    1. Arithmetic operators
    - Addition
    - Subtraction
    - Multiplication
    - Division
    2. Assignment operator
    3. Association operator (=>)
    4. Concatenation operators (||)
    5. Date Operators
    - Addition
    - Subtraction
    6. Hierarchical Query Operators (Connect,CONNECT BY, CONNECT BY PRIOR, and CONNECT BY ROOT)
    7. Set operators
    - Intersect
    - Minus
    - Union all
    - Union
    Last edited by Praetor; 25-01-2010 at 07:58 AM.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    About Conditional operators in queries

    Some conditional operators are explained here with the suitable example which are commonly used in oracle to access the records from database.

    Conditional operators:

    The operators that are being used to access the selected data ,we perform the conditional operators in our queries.

    1. Not equal (<>) operator
    This operator is basically used as name suggested Not equal (<>)operator

    Example: SELECT * FROM employee WHERE id <> 2;

    This query will ignore the 2nd record of employee table.

    2. Greater than operator:
    SELECT id, first_name FROM employee WHERE id > 3;
    This query will select the record of only those employee from employees table whose "id" is greater than 3.

    3. Greater than equal to :
    select id, first_name from employee where id >= 3;

    This query will select only those records whose employee "id" is greater than or equal to 3.

    In this series we can use these operators in different ways. Like <,<= but not =>,=< like that .It follows some rules.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Difference between ANY and ALL in SQL

    ANY:It Compares a value to each value in the list of different values. It occur FALSE if the query doesn't response any result.

    scott@Mine> select empname, salary
    from emp
    where salary > ANY (1600, 2999);


    ALL :It Compares a value to every value in a list. It occur TRUE if the query doesn't return rows.

    scott@Mine> select empname, salary
    from emp
    where salary > ALL (1600, 2999);

Similar Threads

  1. Flashback queries in oracle
    By Laquan in forum Software Development
    Replies: 4
    Last Post: 05-02-2010, 04:56 PM
  2. What does conditional compilation mean in programming
    By Mithun Seth in forum Software Development
    Replies: 4
    Last Post: 04-02-2010, 02:20 PM
  3. Queries of Oracle DBAs and Develpoers
    By Ainsley in forum Software Development
    Replies: 3
    Last Post: 15-01-2010, 10:56 AM
  4. Can we Write conditional statements in CSS?
    By machok in forum Software Development
    Replies: 3
    Last Post: 04-03-2009, 01:34 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,217,866.65681 seconds with 17 queries