Can key constraint application in Database be applied on a part of a single column?

As we know in data bases Key Constraints is the most important concept.
we can apply the key constraint either to column level or table level, but
I want to know is there any possibility that a unique key be applied only on to a part of a single column?
I was asked this question by one of my friends, as far as i know there is no concept like that.

example there is a column named timestamp and value in that column is like 2014-06-23 01:02:03
so i want to apply unique key based on time only, ignoring the date.
is that possible?

So please help me know if there is any possibility.

Replies

  • Nayan Goenka
    Nayan Goenka
    Technically not directly. Ull have to define a rule where the characters preceding the checkarea n following it would have to be masked. So ur basically splitting the value.

    Another approach can be through checksum
  • tanvisharma
    tanvisharma
    thank you Nayan 😀
    but can you be more precise?
    i am talking about databases.
    i am not aware about masking thing, can u help me know how?
  • Manish Goyal
    Manish Goyal
    No you can't, at database level
  • tanvisharma
    tanvisharma
    ok thank you

You are reading an archived discussion.

Related Posts

First of all I would like to apologize for my poor English. I've completed my bachelors degree in electronics and communication. My interest are in the following areas: i. Communication(GSM,...
Good day Sir/Madam Engineers , can someone gives us some background or abstract about this project?? What are the possible components needed to work with this.. Feel free to give...
Regional manufacturers Karbonn Mobiles and Intex have launched three new smartphones that offer Android KitKat experience at affordable prices. Keeping in mind the price of the immensely successful Moto E...
Hello Kaustubh, I am working as a Performance Automation tester..but before joining i have been trained in java... i like watching code work....but i get pissed off when code does...
Plivo, a private Telecommunications industry, was co-founded by Venky B and Michael Ricordeau in September 2011. Plivo has its headquarters located in San Francisco, USA and Bangalore, India. Plivo is...