Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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: unknown_filename
Description: text/html (2.3 KB)

In response to

pgsql-es-ayuda by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group