3

the code below is my sqlcommand for select statement. Inside have a lots of data including two date data inside.

string sql = "SELECT * FROM TASKMASTER WHERE TASKNAME ='" + TaskName + "'";

can I add in ('DD-MM-YYYY HH24:MI:SS')AS CREATEDATE into the sqlcommand and at the same time will call out all the column in the table?

1 Answer 1

4

You could use a table alias.

For example,

SELECT TO_CHAR(t.dt_column, 'DD-MM-YYYY HH24:MI:SS') as CREATEDATE, 
       t.* 
FROM TASKMASTER t 
WHERE t.TASKNAME = '" + TaskName + "'"

So, you added your desired column in the beginning of the column list, and also selecting all other columns followed by it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.