Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread Populating an empty column
Thu, Apr 9 2015 9:52 AMPermanent Link

Boss

Hi I'm trying to union two queries but one has 2 columns and the other has 1. I want to populate the short query with a column matching name and filled with nulls

Query with 4 columns

select a, b,  from alphabet

query with 3 columns

select a, null as b from alphabet
Thu, Apr 9 2015 10:00 AMPermanent Link

Boss

null as b is not the correct syntax to do this.
Thu, Apr 9 2015 10:08 AMPermanent Link

Raul

Team Elevate Team Elevate

On 4/9/2015 9:52 AM, Boss wrote:
> Hi I'm trying to union two queries but one has 2 columns and the other has 1. I want to populate the short query with a column matching name and filled with nulls
> select a, null as b from alphabet

DBISAM does not like "null as b" (it would work for things like string
though '' as c).

I would use something like as a workaround :

select a,NULLIF(a,a) as C from mytable

Raul

Image