Re: alias and select filter from sql
Posted in 2008
Topics: Stored Procedures & SPL
i tred this, but it said synatx error
SELECT Statuswhen 'I' then 'InVALID'
when 'V' then 'VALID'
else 'unknown'
end
FROM location;
am i missing something??
Superboer wrote:
>SELECT nvl(MyLocationStatus,"NULL")
>WHEN 'I' THEN 'INVALID'
>WHEN 'V' THEN 'VALID'
>WHEN 'NULL' THEN 'NULL'
>ELSE 'UNKOWN'
>END
>FROM location
>
>> select
>Round(([act_arrival_dt]-(DateValue([appt_nlt_date])+TimeValue(
>> [appt_nlt_time])))*24*60) AS VarianceInMins from appointment;
>
>hmmm dono whar the above all means, however this can be done in an
>spl.
>
>Superboer.
>
>way fast=http://www.clipjes.nl/clip/nederlands/n/normaal_-
>_oerend_hard.html
--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/informix/200803/1
Select DECODE(Status,'I','InVALID','V','VALID','UNKNOWN') FROM location;
Randy
-----Original Message-----
From: informix-list-bounces@iiug.org
[mailto:informix-list-bounces@iiug.org] On Behalf Of vchu via
DBMonster.com
Sent: Tuesday, March 25, 2008 11:26 AM
To: informix-list@iiug.org
Subject: Re: alias and select filter from sql
i tred this, but it said synatx error
SELECT Statuswhen 'I' then 'InVALID'
when 'V' then 'VALID'
else 'unknown'
end
FROM location;
am i missing something??
Superboer wrote:
>SELECT nvl(MyLocationStatus,"NULL")
>WHEN 'I' THEN 'INVALID'
>WHEN 'V' THEN 'VALID'
>WHEN 'NULL' THEN 'NULL'
>ELSE 'UNKOWN'
>END
>FROM location
>
>> select
>Round(([act_arrival_dt]-(DateValue([appt_nlt_date])+TimeValue(
>> [appt_nlt_time])))*24*60) AS VarianceInMins from appointment;
>
>hmmm dono whar the above all means, however this can be done in an spl.
>
>Superboer.
>
>way fast=http://www.clipjes.nl/clip/nederlands/n/normaal_-
>_oerend_hard.html
--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/informix/200803/1
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list
thanks a lot :)
sorry I do have one more question... do we have something like
select right(left(contract,2),1) from contract;
so that i can get the second char of the contract;
Thanks
Victor
Kennedy, Randy wrote:
>Select DECODE(Status,'I','InVALID','V','VALID','UNKNOWN') FROM location;
>
>Randy
>
>-----Original Message-----
>From: informix-list-bounces@iiug.org
>[mailto:informix-list-bounces@iiug.org] On Behalf Of vchu via
>DBMonster.com
>Sent: Tuesday, March 25, 2008 11:26 AM
>To: informix-list@iiug.org
>Subject: Re: alias and select filter from sql
>
>i tred this, but it said synatx error
>
>SELECT Status>when 'I' then 'InVALID'
>when 'V' then 'VALID'
>else 'unknown'
>end
>FROM location;
>
>am i missing something??
>
>Superboer wrote:
>>SELECT nvl(MyLocationStatus,"NULL")
>>WHEN 'I' THEN 'INVALID'
>[quoted text clipped - 14 lines]
>>way fast=http://www.clipjes.nl/clip/nederlands/n/normaal_-
>>_oerend_hard.html
>
>_______________________________________________
>Informix-list mailing list
>Informix-list@iiug.org
>http://www.iiug.org/mailman/listinfo/informix-list
--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/informix/200803/1
Select contract[2,1] ...
or select substr(contract,2,1) ...
or select substring(contract from 2 for 1) ...
I usually use substr as its syntax is like left that I am used to and
more descriptive in what it is doing than [], but have some with the []
notation, never used substring.
Thanks,
Randy
-----Original Message-----
From: informix-list-bounces@iiug.org
[mailto:informix-list-bounces@iiug.org] On Behalf Of vchu via
DBMonster.com
Sent: Tuesday, March 25, 2008 12:39 PM
To: informix-list@iiug.org
Subject: RE: alias and select filter from sql
thanks a lot :)
sorry I do have one more question... do we have something like
select right(left(contract,2),1) from contract;
so that i can get the second char of the contract;
Thanks
Victor
Kennedy, Randy wrote:
>Select DECODE(Status,'I','InVALID','V','VALID','UNKNOWN') FROM
>location;
>
>Randy
>
>-----Original Message-----
>From: informix-list-bounces@iiug.org
>[mailto:informix-list-bounces@iiug.org] On Behalf Of vchu via
>DBMonster.com
>Sent: Tuesday, March 25, 2008 11:26 AM
>To: informix-list@iiug.org
>Subject: Re: alias and select filter from sql
>
>i tred this, but it said synatx error
>
>SELECT Status>when 'I' then 'InVALID'
>when 'V' then 'VALID'
>else 'unknown'
>end
>FROM location;
>
>am i missing something??
>
>Superboer wrote:
>>SELECT nvl(MyLocationStatus,"NULL")
>>WHEN 'I' THEN 'INVALID'
>[quoted text clipped - 14 lines]
>>way fast=http://www.clipjes.nl/clip/nederlands/n/normaal_-
>>_oerend_hard.html
>
>_______________________________________________
>Informix-list mailing list
>Informix-list@iiug.org
>http://www.iiug.org/mailman/listinfo/informix-list
--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/informix/200803/1
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list
Thanks again!!!!! Kennedy, Randy wrote: >Select contract[2,1] ... >or select substr(contract,2,1) ... >or select substring(contract from 2 for 1) ... > >I usually use substr as its syntax is like left that I am used to and >more descriptive in what it is doing than [], but have some with the [] >notation, never used substring. > >Thanks, >Randy > >-----Original Message----- >From: informix-list-bounces@iiug.org >[mailto:informix-list-bounces@iiug.org] On Behalf Of vchu via >DBMonster.com >Sent: Tuesday, March 25, 2008 12:39 PM >To: informix-list@iiug.org >Subject: RE: alias and select filter from sql > >thanks a lot :) > >sorry I do have one more question... do we have something like > >select right(left(contract,2),1) from contract; > >so that i can get the second char of the contract; > >Thanks >Victor > >Kennedy, Randy wrote: >>Select DECODE(Status,'I','InVALID','V','VALID','UNKNOWN') FROM >>location; >[quoted text clipped - 31 lines] >>Informix-list@iiug.org >>http://www.iiug.org/mailman/listinfo/informix-list > >_______________________________________________ >Informix-list mailing list >Informix-list@iiug.org >http://www.iiug.org/mailman/listinfo/informix-list -- Message posted via http://www.dbmonster.com