coding style - SQL - Select null as FIELDNAME? -


i have come across code says

select null unitcost, null markup 

what doing? getting field names unitcost , markup?

why use "select null as..."?

new sorry.

thanks.

that code aliasing value null , calling unitcost/markup. not selecting column available table.

you see when statement requires matching column sets, e.g. union all.

select id, col1, col2, null unitcost, null markup table_1 union select id, null col1, null col2, unitcode, markup table_2 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -