MYSQL: How to make NULL or empty data default to 0 during insert

前端 未结 5 2597
走了就别回头了
走了就别回头了 2021-02-20 01:07

So this seems like it would be pretty straight forward and I swear I\'ve done this before, but for some reason it\'s just not working for me.

I am using MAMP

5条回答
  •  -上瘾入骨i
    2021-02-20 01:25

    Maybe you should try this:

    insert into listings (ListingID, ListingID, BathsFull) 
    values (@listing_id, @ListingID, isnull(BathsFull, 0)
    

提交回复
热议问题