string function

This is a multi-part message in MIME format.

------=_NextPart_000_0144_01C82C31.FBB67EC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi All,
Having a little issue, and can't seem to figure it out!


Every time I try to run this select command I get this error:

select left(kd_aln,2) as code from airlin

the error msg is : function left(character varying, integer) does not =
exist

How to resolve this problem

Thank for your attention

Regards

Nyoman/Bali

------=_NextPart_000_0144_01C82C31.FBB67EC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.3132" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi All,</FONT></DIV>
<DIV>
<P dir=3Dltr><FONT face=3DArial><SPAN lang=3Den-us>Having a little =
issue, and
can</SPAN><SPAN lang=3Den-us>=92</SPAN><SPAN lang=3Den-us>t seem to =
figure it
out!</SPAN></FONT></P>
<P dir=3Dltr><SPAN lang=3Den-us><FONT face=3DArial></FONT></SPAN></P>
<P dir=3Dltr><FONT face=3DArial><SPAN lang=3Den-us>Every time I try =
to</SPAN><SPAN
lang=3Den-us> run this select command I get this =
error:</SPAN></FONT></P>
<P dir=3Dltr><SPAN lang=3Den-us>select left(kd_aln,2) as code from =
airlin</SPAN></P>
<P dir=3Dltr><SPAN lang=3Den-us>the error msg is : function =
left(character varying,
integer) does not exist</SPAN></P>
<P dir=3Dltr><SPAN lang=3Den-us>How to resolve this problem</SPAN></P>
<P dir=3Dltr><SPAN lang=3Den-us><FONT face=3DArial size=3D2>Thank for =
your
attention</FONT></SPAN></P>
<P dir=3Dltr><SPAN lang=3Den-us><FONT face=3DArial =
size=3D2>Regards</FONT></SPAN></P>
<P dir=3Dltr><SPAN lang=3Den-us><FONT face=3DArial
size=3D2>Nyoman/Bali</FONT></SPAN></P></DIV></BODY></HTML>

------=_NextPart_000_0144_01C82C31.FBB67EC0--
gunartha.nyoman [ Mi, 21 November 2007 20:30 ] [ ID #1875774 ]

Re: string function

gunartha wrote:
> select left(kd_aln,2) as code from airlin
>
> the error msg is : function left(character varying, integer) does not exist
>


For a complete list of string functions, look here:

http://www.postgresql.org/docs/8.2/interactive/functions-str ing.html

Perhaps you meant to use ...

select substr(kd_aln,1,2) as code from airlin


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
Frank Bax [ Mi, 21 November 2007 04:53 ] [ ID #1875775 ]
Datenbanken » gmane.comp.db.postgresql.php » string function

Vorheriges Thema: Installation Error for installation of Apache-1.3.39+php-5.2.5+OpenSSL-0.9.8g+PostgreSQL-8.1.10
Nächstes Thema: Normalization tools for postgres?