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

  • SEARCH
  • Home
  • 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 7816527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:53:52+00:00 2026-06-02T05:53:52+00:00

I need to obtain the last two digits of an integer. Each element placed

  • 0

I need to obtain the last two digits of an integer. Each element placed in the tables comes as a full year ie. YYYY and I only want the last two digits, so that all the fields show

YEAR
----
09
00
89

where the initialy field was

YEAR
----
2009
2000
1989

EDIT: I get a complaint saying,

HINT: No function matches the given name and argument types. You might need to add explicit type casts.

when i try

select right(cast(year as char),2) from subjects;

  • 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-02T05:53:54+00:00Added an answer on June 2, 2026 at 5:53 am

    Postgres has borrowed (or inherited) the modulus operator from C:

    SET search_path='tmp';
    
    CREATE TABLE lutser ( year integer);
    
    INSERT INTO lutser (year)
            SELECT generate_series(1991,2012)
        ;
    
    SELECT year
        , year / 100 as c2
        , year % 100 AS y2
        FROM lutser
        ;
    

    Result:

    CREATE TABLE
    INSERT 0 22
     year | c2 | y2 
    ------+----+----
     1991 | 19 | 91
     1992 | 19 | 92
     1993 | 19 | 93
     1994 | 19 | 94
     1995 | 19 | 95
     1996 | 19 | 96
     1997 | 19 | 97
     1998 | 19 | 98
     1999 | 19 | 99
     2000 | 20 |  0
     2001 | 20 |  1
     2002 | 20 |  2
     2003 | 20 |  3
     2004 | 20 |  4
     2005 | 20 |  5
     2006 | 20 |  6
     2007 | 20 |  7
     2008 | 20 |  8
     2009 | 20 |  9
     2010 | 20 | 10
     2011 | 20 | 11
     2012 | 20 | 12
    (22 rows)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to remove the last child of an element only if the class =
i need to obtain the name of a process by only knowing the HWND
I need to obtain the server time but I only have javascript to play
I need to obtain the intersection of two curves. The problem I'm facing can
I need to obtain the memory address of the first element of an array
I need to obtain the number of parameters a given block takes. For example:
I need to obtain actual height of several different elements (for the sake of
I need to obtain the Thread Id from a window create in runtime with
I have a very huge file in which I need to obtain every nth
I need to obtain the velocity of an android device, based on the accelerometer

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.