EN VI

Postgresql - How create a new table, which will have a specific value?

2024-03-13 23:00:06
Postgresql - How create a new table, which will have a specific value

I want to create a new table that will have the value date (yyyy-mm-dd).

I tried to give a date while creating table, but I don't know what to do after that, like what I should to do when I'm writing INSERT INTO appointments (appointment_date) VALUES(???)
I researched, but didn't find anything simple, can someone say me that in simple words please?

Solution:

Not sure about the question, but to insert a date you can do it like this:

INSERT INTO appointments (appointment_date) VALUES('2024-03-01');

Or for today:

INSERT INTO appointments (appointment_date) VALUES(CURRENT_DATE);

Or unknown date, NULL:

INSERT INTO appointments (appointment_date) VALUES(NULL);

See the manual

Answer

Login


Forgot Your Password?

Create Account


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

Reset Password

Back to login