0

If I have a table

Goods have a nullable column receivedStockId

receivedStockId INT64

I cannot write a select-statement like below:

select * from Goods where receivedStockId=@receivedStockId

My current solution is:

select * from Goods where receivedStockId in UNNEST([@receivedStockId])

Is there any better solution?

Maxim
  • 4,075
  • 1
  • 14
  • 23
Chipintoza
  • 295
  • 4
  • 16
  • What happens when you run the first query? It looks like it should work: NULL = something evaluates to NULL, which is not true per https://cloud.google.com/spanner/docs/functions-and-operators#operators – Tom Ayles Nov 28 '17 at 21:12
  • Thank you @TomAyles... I made mistake, and I did not specify type to the parameter: types.receivedStockId = 'int64' – Chipintoza Dec 11 '17 at 08:04

0 Answers0