<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://sqlzoo.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://sqlzoo.net/w/index.php?title=CAST/de&amp;feed=atom&amp;action=history</id>
		<title>CAST/de - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://sqlzoo.net/w/index.php?title=CAST/de&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=CAST/de&amp;action=history"/>
		<updated>2013-05-23T13:37:27Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.4</generator>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=CAST/de&amp;diff=4367&amp;oldid=prev</id>
		<title>Peter at 11:51, 28 October 2012</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=CAST/de&amp;diff=4367&amp;oldid=prev"/>
				<updated>2012-10-28T11:51:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 11:51, 28 October 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Häufig wird vom DBMS eine implizite Typumwandlung durchgeführt. Werden z.B. eine Zeichenkette (String) und eine Zahl zu einem Wert zusammengefasst, dann wird die Zahl implizit in eine Zeichenkette umgewandelt. Manchmal muss die Typumwandlung auch explizit mittels CAST formuliert werden. &amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;p&amp;gt;Häufig wird vom DBMS eine implizite Typumwandlung durchgeführt. Werden z.B. eine Zeichenkette (String) und eine Zahl zu einem Wert zusammengefasst, dann wird die Zahl implizit in eine Zeichenkette umgewandelt. Manchmal muss die Typumwandlung auch explizit mittels CAST formuliert werden. &amp;lt;/p&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre style='width:60ex'&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre style='width:60ex'&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; CAST(&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;expr &lt;/del&gt;TO &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;type&lt;/del&gt;) &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160; CAST(&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Ausdruck &lt;/ins&gt;TO &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Datentyp&lt;/ins&gt;) &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Peter</name></author>	</entry>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=CAST/de&amp;diff=4110&amp;oldid=prev</id>
		<title>Peter: Created page with &quot;Category:Deutsch &lt;table align='right' border='1'&gt; &lt;caption&gt;Kompatibilität&lt;/caption&gt; &lt;tr&gt;&lt;th colspan='3'&gt;CAST(expr AS type)&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td align='center'&gt;'''DBMS'''&lt;/td...&quot;</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=CAST/de&amp;diff=4110&amp;oldid=prev"/>
				<updated>2012-10-01T09:50:35Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/wiki/Category:Deutsch&quot; title=&quot;Category:Deutsch&quot;&gt;Category:Deutsch&lt;/a&gt; &amp;lt;table align=&amp;#039;right&amp;#039; border=&amp;#039;1&amp;#039;&amp;gt; &amp;lt;caption&amp;gt;Kompatibilität&amp;lt;/caption&amp;gt; &amp;lt;tr&amp;gt;&amp;lt;th colspan=&amp;#039;3&amp;#039;&amp;gt;CAST(expr AS type)&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt; &amp;lt;tr&amp;gt;&amp;lt;td align=&amp;#039;center&amp;#039;&amp;gt;&amp;#039;&amp;#039;&amp;#039;DBMS&amp;#039;&amp;#039;&amp;#039;&amp;lt;/td...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Deutsch]]&lt;br /&gt;
&amp;lt;table align='right' border='1'&amp;gt;&lt;br /&gt;
&amp;lt;caption&amp;gt;Kompatibilität&amp;lt;/caption&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;th colspan='3'&amp;gt;CAST(expr AS type)&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td align='center'&amp;gt;'''DBMS'''&amp;lt;/td&amp;gt;&amp;lt;td align='center'&amp;gt;'''OK'''&amp;lt;/td&amp;gt;&amp;lt;td align='center'&amp;gt;'''Alternative'''&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td align='left'&amp;gt;Ingres&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Ja&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td align='left'&amp;gt;MySQL&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Ja&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td align='left'&amp;gt;Oracle&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Ja&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td align='left'&amp;gt;PostgreSQL&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Ja&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;tr&amp;gt;&amp;lt;td align='left'&amp;gt;SQL Server&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Ja&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h1&amp;gt;CAST&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Mittels CAST können die Datentypen der Spaltenwerte ineinander umgewandelt werden.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Häufig wird vom DBMS eine implizite Typumwandlung durchgeführt. Werden z.B. eine Zeichenkette (String) und eine Zahl zu einem Wert zusammengefasst, dann wird die Zahl implizit in eine Zeichenkette umgewandelt. Manchmal muss die Typumwandlung auch explizit mittels CAST formuliert werden. &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre style='width:60ex'&amp;gt;&lt;br /&gt;
 CAST(expr TO type) &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class='qu'&amp;gt;&lt;br /&gt;
In diesem Beispiel wird die Bevölkerungszahl (population) in Millionen ermittelt und die Fließkommazahl mittels DECIMAL(8,1) auf eine Dezimalstelle nach dem Komma gewandelt. Mittels CAST könnte bspw. auch ein Datum in eine Zeichenkette umgewandelt werden, um Teile davon mittels SUBSTRING-Funktion zu bearbeiten.   &lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;&lt;br /&gt;
SELECT CAST(population/1000000 &lt;br /&gt;
       AS DECIMAL(8,1)) AS a,&lt;br /&gt;
       population/1000000 AS b&lt;br /&gt;
FROM bbc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Languages}}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>	</entry>

	</feed>