<?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=Who_am_I%3F&amp;feed=atom&amp;action=history</id>
		<title>Who am I? - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://sqlzoo.net/w/index.php?title=Who_am_I%3F&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Who_am_I%3F&amp;action=history"/>
		<updated>2013-05-19T18:58:03Z</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=Who_am_I%3F&amp;diff=1510&amp;oldid=prev</id>
		<title>Connor: Created page with &quot;Who am I - what is my user id? &lt;div class='ht'&gt; &lt;div class=params&gt;schema:gisq&lt;/div&gt; &lt;div&gt; Find the user name or user id. The SQL standard permits the function &lt;code&gt;USER&lt;/code...&quot;</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Who_am_I%3F&amp;diff=1510&amp;oldid=prev"/>
				<updated>2012-07-17T13:46:52Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Who am I - what is my user id? &amp;lt;div class=&amp;#039;ht&amp;#039;&amp;gt; &amp;lt;div class=params&amp;gt;schema:gisq&amp;lt;/div&amp;gt; &amp;lt;div&amp;gt; Find the user name or user id. The SQL standard permits the function &amp;lt;code&amp;gt;USER&amp;lt;/code...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Who am I - what is my user id?&lt;br /&gt;
&amp;lt;div class='ht'&amp;gt;&lt;br /&gt;
&amp;lt;div class=params&amp;gt;schema:gisq&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
Find the user name or user id.&lt;br /&gt;
The SQL standard permits the function &amp;lt;code&amp;gt;USER&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;source lang=sql class='tidy'&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=sql class='setup'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-sqlite'&amp;gt;SELECT user FROM anyoldtable&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-db2'&amp;gt;SELECT user FROM anyoldtable&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-ingres'&amp;gt;SELECT user FROM anyoldtable&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-access'&amp;gt;SELECT user FROM anyoldtable&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-postgres'&amp;gt;select user&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-oracle'&amp;gt;SELECT user, uid FROM dual&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-sqlserver'&amp;gt;USE scott;&lt;br /&gt;
SELECT user, user_id();&lt;br /&gt;
USE gisq;&lt;br /&gt;
SELECT user, user_id()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-mysql'&amp;gt;SELECT user()&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-mimer'&amp;gt;SELECT user FROM anyoldtable&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-sybase'&amp;gt;USE scott;&lt;br /&gt;
SELECT user, user_id();&lt;br /&gt;
USE gisq;&lt;br /&gt;
SELECT user, user_id()&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-oracle&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;The functions are &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;uid&amp;lt;/code&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-sqlserver&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;When you are in a database that you own the answer is dbo (database owner). If you USE someone else's database then you get a user id. (the machine being used to connect to MySQL).&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-mysql&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;The user() function include the user name and the name of the machine you are using. In this case the perl script feeding the result page is on the same machine as the database so we get &amp;lt;code&amp;gt;localhost&amp;lt;/code&amp;gt;.&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-sybase&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;When you are in a database that you own the answer is dbo (database owner). If you &amp;lt;code&amp;gt;USE&amp;lt;/code&amp;gt; someone else's database then you get a user id. (the machine being used to connect to MySQL).&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{Users ref}}&lt;/div&gt;</summary>
		<author><name>Connor</name></author>	</entry>

	</feed>