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 arguments
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 application
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 SQL
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, Wi
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?
5 matches
Mail list logo