Logical Operations in @if in select statements

forum.wishlist (1998-2005) & forum.gupta.wishlist (2005-2010)
RainerE
Germany
Posts: 2053
Joined: 27 Apr 2021, 12:40
Location: Germany

Logical Operations in @if in select statements

Post by RainerE » 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 Bass

Re: Logical Operations in @if in select statements

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

 Posted by:  Clifford W. Bass 

Hello Gupta,

I enthusiastically second that!

Clifford Bass

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

Re: 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 Bass

Re: Logical Operations in @if in select statements

Post by Clifford 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

Re: 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

RainerE
Germany
Posts: 2053
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: Logical Operations in @if in select statements

Post by RainerE » 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