[sqlite] How to get 1 row with no null columns

2016-05-11 Thread Simon Slavin
On 11 May 2016, at 11:26am, William Drago wrote: > Is there a simple way to find a row in a table where none of columns contain > a null value? For example: > > SELECT * FROM AnyTable WHERE (all columns IS NOT NULL) LIMIT 1; The coalesce(a,b,c, ...) function returns the first of its

[sqlite] How to get 1 row with no null columns

2016-05-11 Thread Kees Nuyt
On Wed, 11 May 2016 06:26:23 -0400, William Drago wrote: > All, > > Is there a simple way to find a row in a table where none of > columns contain a null value? For example: > > SELECT * FROM AnyTable WHERE (all columns IS NOT NULL) LIMIT 1; > > Or do I have to do this manually in my

[sqlite] How to get 1 row with no null columns

2016-05-11 Thread Jean-Luc Hainaut
Le 12:26 11/05/2016, vous avez ?crit: >All, > >Is there a simple way to find a row in a table where none of columns contain a >null value? For example: > >SELECT * FROM AnyTable WHERE (all columns IS NOT NULL) LIMIT 1; select * from AnyTable col1||col2||...||coln is not nul limit 1; Fine for

[sqlite] How to get 1 row with no null columns

2016-05-11 Thread Scott Robison
I also cannot think of a way to do this without naming columns. If this is something you have to do frequently from multiple locations, it might be worth creating a view that does the hard work in one place. On Wed, May 11, 2016 at 10:29 AM, Simon Slavin wrote: > > On 11 May 2016, at 11:26am,

[sqlite] How to get 1 row with no null columns

2016-05-11 Thread William Drago
All, Is there a simple way to find a row in a table where none of columns contain a null value? For example: SELECT * FROM AnyTable WHERE (all columns IS NOT NULL) LIMIT 1; Or do I have to do this manually in my application scanning every column in every row until I find a row with no nulls?