add a temporary column with a value

前端 未结 6 1525
萌比男神i
萌比男神i 2021-01-31 07:35

I have a select statement like this

select field1, field2  
  from table1

What I want is to have a newfield with only value \"example\".

<
6条回答
  •  滥情空心
    2021-01-31 07:58

    I'm rusty on SQL but I think you could use select as to make your own temporary query columns.

    select field1, field2, 'example' as newfield from table1
    

    That would only exist in your query results, of course. You're not actually modifying the table.

提交回复
热议问题