Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8288973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:23:52+00:00 2026-06-08T12:23:52+00:00

I am creating one query. In that query i want minus date from system

  • 0

I am creating one query. In that query i want minus date from system date. My table is like below.

Table Name : Employee
---------------------
ID
NAME
JOINDATE

I am writing this query to fetch my result

SELECT * FROM SS.EMPLOYEE WHERE (sysdate - JOINDATE)='05-Ded-11'

This throws the following error:

SQL Error: ORA-00920: invalid relational operator

So how to do this???If anyone knows than please help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:23:53+00:00Added an answer on June 8, 2026 at 12:23 pm

    In Oracle date arithmetics, subtracting two dates results in the number of days between the two dates:

    SQL> SELECT DATE '2000-12-31' - DATE '2000-01-01' year FROM DUAL;
    
          YEAR
    ----------
           365
    

    Your WHERE clause is therefore incorrect to Oracle since it cannot compare a number to a date. What exactly do you want to express with this comparison?

    If you want to filter all dates before a given date, just compare the two dates:

    SELECT * FROM SS.EMPLOYEE WHERE joindate <= to_date('2011-12-05', 'yyyy-mm-dd')
    

    If you want to select all rows that are in a given interval, you can use multiple comparisons or the operator BETWEEN:

    SELECT * 
      FROM SS.EMPLOYEE 
     WHERE joindate BETWEEN to_date('2011-12-05', 'yyyy-mm-dd') AND SYSDATE
    

    Update

    The number of months between two dates is given by the function MONTHS_BETWEEN. You would compare the result of this function to a number (of months).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating one asp page. In that page i defined one property like
Somehow am not successful with creating the query that I want. DB is to
I want to create a veiw and then select from it in one query,
i am dynamically creating sql query for inserting multiple records in one hit.Suppose no
I am creating one form in html using table. Which have one Drop down
I've creating one ASP web application, in that application one form have to update
I am creating one application in which i am using jsp/servlet.. I want to
I'm working on creating a Hibernate query engine that can create dynamic queries. Thus
I want to make a query using which I can check that URL which
I am having problems creating a table in python. Basically I want to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.