[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Fwd: [sqr-users] SQL Question
- Subject: Re: Fwd: [sqr-users] SQL Question
- From: "George Jansen" <GJANSEN@aflcio.org>
- Date: Tue, 04 Oct 2005 16:24:27 -0400
- Delivery-date: Tue, 04 Oct 2005 15:25:50 -0500
- List-id: "This list is for discussion about the SQR database reportinglanguage from Hyperion Solutions." <sqr-users.sqrug.org>
If this is the only time you'll need to do it, good. If not, look into creating
a stored procedure, call it, say "nth_token". First parameter is the string to
pull that token out of, 2nd is number (defaulted to 1st if you like), 3rd is a
delimiter list, defaulted to a space.
>>> Tchaha@Roushind.com 10/04/05 3:26 PM >>>
Thanks a lot Amy. I changed the query a little bit for DB2:
select substr('How are you', 1,locate(' ','How are you')) from dual.
>>> Amy Eldridge <emgeac@muohio.edu> 10/04/05 01:07PM >>>
Lacking a better technique, I'd probably do this:
select substr('How are you',1,instr('How are you',' ',1)-1) from dual
A.
>X-Mailer: Novell GroupWise Internet Agent 6.0.4
>Date: Tue, 04 Oct 2005 11:54:38 -0400
>From: "Tajinder Chahal" <Tchaha@Roushind.com>
>To: <sqr-users@sqrug.org>
>Subject: [sqr-users] SQL Question
>X-BeenThere: sqr-users@sqrug.org
>X-Mailman-Version: 2.1.5
>Reply-To: "This list is for discussion about the SQR database reporting
> language from Hyperion Solutions." <sqr-users@sqrug.org>
>List-Id: "This list is for discussion about the SQR database reporting
> language from Hyperion Solutions." <sqr-users.sqrug.org>
>List-Unsubscribe: <http://www.sqrug.org/mailman/listinfo/sqr-users>,
> <mailto:sqr-users-request@sqrug.org?subject=unsubscribe>
>List-Post: <mailto:sqr-users@sqrug.org>
>List-Help: <mailto:sqr-users-request@sqrug.org?subject=help>
>List-Subscribe: <http://www.sqrug.org/mailman/listinfo/sqr-users>,
> <mailto:sqr-users-request@sqrug.org?subject=subscribe>
>Sender: sqr-users-bounces+emgeac=muohio.edu@sqrug.org
>X-Real-ConnectIP: 199.164.165.113
>X-Scanned-By: MIMEDefang 2.45
>X-Scanned-By: MIMEDefang 2.52 on 134.53.6.11
>
>Hi All,
>
>I know this is not a SQL discussion forum but I think SQL is the base
>language used for all the databases. That is why I'm posting my question here.
>
>Which function in DB2 can I use to get the column value before it hits the
>blank space.
>
>E.g.
>1. 'How are you' - I only want to display 'How'.
>2. 'This is a test' - I only want to display 'This'.
>
>Any help would be greatly appreciated.
>
>Thanks,
>
>Tajinder
>
>
>
>_______________________________________________
>sqr-users mailing list
>sqr-users@sqrug.org
>http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users