I'm a total beginner in mysql. I have a table with 5 columns. One of the columns is of type DATE. What I want is, read all the columns of one row and from the DATE column read only the date without timezone. How can I achieve this?
I know that selecting all the fields in one row requires query like this:
SELECT * FROM table_name;
And to display only the date from DATE type (the answer I found in another question) is:
select DATE_FORMAT(date,'%d') from tablename
Is there a way to merge these queries into one that would do what I want it to do?
EDIT: This mysql database is integrated into a Node.js server. I wanted to make one query to get all the information from one row with an ID that I have and read the results in Node.js.
This is how I made the table in the database:
CREATE TABLE requests (id INT NOT NULL AUTO_INCREMENT,patient_name TEXT NOT NULL, patient_email TEXT NOT NULL, requested_date DATE NOT NULL,requested_time TIME NOT NULL,status ENUM('submitted','accepted','declined') , PRIMARY KEY(id));
When I make this query in Node.js:
SELECT * FROM requests WHERE id = 4;
I get the 4th row, and when I read the 'requested_date' it has the value: e.g. Tue Feb 24 2015 00:00:00 GMT+0100 (CET). What I want is to read only the date without the "00:00:00 GMT+0100 (CET)" part.