Reputation: 91
I have a db table created as follows :
CREATE TABLE mktDB(
mktID number(19) not null,
featureId number(20) not null,
val varchar(100) not null,
primary key (id)
);
I want to view all the records along with an additional field having current date with each row in the db.
I tried the following sqlite query but it is erroneous :
SELECT *, CURRENT_DATE FROM mktDB,DATE;
Upvotes: 0
Views: 59
Reputation: 711
Don't know SQLite very well but after typing "current date sqllite" in google it shows me the way to https://www.sqlite.org/lang_datefunc.html
and for your problem:
SELECT *, date('now') FROM mktDB;
P.S: I always wanted to try SQL fiddle. So here it is:
http://sqlfiddle.com/#!7/92fd6/3
Upvotes: 3
Reputation: 11527
1) The function is date('now')
2) You don't need to select from DATE
SELECT *, date('now') FROM mktDB;
Upvotes: 1