Logical Operations in @if in select statements

forum.wishlist (1998-2005) & forum.gupta.wishlist (2005-2010)
Rainer Ebert

Logical Operations in @if in select statements

Post by Rainer Ebert » 20 Oct 2006, 09:28

 Posted by:  Rainer Ebert 

It would be very very helpful, if the first parameter of the function @if in
select statements could contain logical operations like =, , >=. So
that you e.g. can select as value column a or column b depending on which of
them is lager. Like "select @if( a > b, a, b ) from mytable".

Rainer

Clifford W. Bass

Logical Operations in @if in select statements

Post by Clifford W. Bass » 20 Oct 2006, 18:04

 Posted by:  Clifford W. Bass 

Hello Gupta,

I enthusiastically second that!

Clifford Bass

Scott
Australia
Posts: 453
Joined: 13 Mar 2017, 23:31
Location: Sydney, Australia

Logical Operations in @if in select statements

Post by Scott » 25 Oct 2006, 07:57

 Posted by:  Scott Booth 

Not ideal, but it does work...

@if( a > b, a, b ) can be implemented as @if((b - a) + @abs(b - a),a,b)

Clifford W. Bass

Logical Operations in @if in select statements

Post by Clifford W. Bass » 25 Oct 2006, 17:43

 Posted by:  Clifford W. Bass 

Hi Scott,

Yeah, there are some workarounds, but they are clunky and not easily
understandable by anyone who is not familiar with them. And, more
importantly, you cannot do text comparisons. Date comparisons are tricky to
accomplish. If you want to use ANDs and ORs and NOTs it gets even more
convoluted. MS Access lets you do all kinds of conditions / calculations in
their IIf() function and it just plain blows SQLBase out of the water for
ease of use.

My $0.02 worth,

Clifford Bass

Fridolin Schwarz

Logical Operations in @if in select statements

Post by Fridolin Schwarz » 26 Oct 2006, 12:44

 Posted by:  Fridolin Schwarz 


ANSI-SQL supports a CASE-command. When does SQLBase?

fritz

Rainer Ebert

Logical Operations in @if in select statements

Post by Rainer Ebert » 26 Oct 2006, 16:21

 Posted by:  Rainer Ebert 

I agree that it would be nice to have a CASE-command in SQLBase.

Rainer

Return to “gupta.wishlist”

Who is online

Users browsing this forum: [Ccbot] and 0 guests