Re: consulta operador /

From: Jose Carlos Chevarria <jchevarria(at)yarkan(dot)com(dot)pe>
To: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: consulta operador /
Date: 2008-02-22 18:01:01
Message-ID: 47BF0DDD.8010402@yarkan.com.pe
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ana Smail escribi&oacute;:
<blockquote cite="mid:E1JSb8s-0003uY-Rg(at)apu(dot)unnoba(dot)edu(dot)ar" type="cite">
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="Generator" content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EstiloCorreo17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
{page:Section1;}
-->
</style>
<div class="Section1">
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">El operador / aplicado a
integer trunca el resultado y
devuelve un entero. La &uacute;nica forma de que no trunque el resultado es
haciendo
un casteo de tipo?<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">SELECT &frac12; &nbsp;devuelve 0<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">SELECT 1::NUMERIC/2
devuelve 0.50<o:p></o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;"><o:p>&nbsp;</o:p></span></font></p>
<p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size: 10pt; font-family: Arial;">Gracias. Ana</span></font></p>
</div>
</blockquote>
El resultado depende de los tipos de datos:<br>
Entero / Entero = Entero<br>
Decimal / Entero = Decimal<br>
Entero / Decimal = Decimal<br>
Decimal / Decimal = Decimal<br>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 2.3 KB

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Fevis Koste 2008-02-22 19:22:36 Ejecutar comando archivos .BAT y .EXE desde postgres
Previous Message Ana Smail 2008-02-22 17:55:35 consulta operador /