<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>p2p.wrox.com Forums - SQL Language</title>
		<link>http://p2p.wrox.com</link>
		<description>SQL Language discussions not specific to a particular RDBMS program or vendor.</description>
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 23:46:23 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://p2p.wrox.com/images/misc/rss.jpg</url>
			<title>p2p.wrox.com Forums - SQL Language</title>
			<link>http://p2p.wrox.com</link>
		</image>
		<item>
			<title>Max value of a groupby query</title>
			<link>http://p2p.wrox.com/sql-language/77042-max-value-groupby-query.html</link>
			<pubDate>Sun, 15 Nov 2009 17:24:45 GMT</pubDate>
			<description>Hi,

I have this table named Sales with this data


Table: Sales
------------------
Salesman       Amount
--------------------
Ben               1</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I have this table named Sales with this data<br />
<br />
<br />
Table: Sales<br />
------------------<br />
Salesman       Amount<br />
--------------------<br />
Ben               1<br />
Steve            2<br />
Ben               3<br />
<br />
then i do this query<br />
<br />
select Salesman, sum(amount) as Total<br />
from Sales<br />
group by Salesman<br />
<br />
the results are<br />
<br />
---------------------<br />
Salesman       Amount<br />
---------------------<br />
<br />
Ben                    4<br />
Steve                 2<br />
<br />
<br />
The query i want is one that gives me the maximum amount of sales (4).<br />
<br />
I have tried this, but it is wrong<br />
<br />
<br />
select max(Total) from<br />
(select Salesman, sum(amount) as Total<br />
from Sales<br />
group by Salesman)<br />
<br />
<br />
I am using microsoft SQL Server 2005<br />
<br />
thanks in advance!</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/sql-language-100/">SQL Language</category>
			<dc:creator>diegoblin</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/sql-language/77042-max-value-groupby-query.html</guid>
		</item>
		<item>
			<title>Coping data from db to another on diff server</title>
			<link>http://p2p.wrox.com/sql-language/76888-coping-data-db-another-diff-server.html</link>
			<pubDate>Tue, 03 Nov 2009 20:58:41 GMT</pubDate>
			<description>Need help.  

On server x I have a large SQL server 2000 database (Call it A)  with a very large amount of daily transactions.  The database X only...</description>
			<content:encoded><![CDATA[<div>Need help.  <br />
<br />
On server x I have a large SQL server 2000 database (Call it A)  with a very large amount of daily transactions.  The database X only holds 6 months worth of data the rest is archived to tape.  We keep only six months of data so the performance of the application is not affected.<br />
<br />
<br />
On Server y  I have a copy of database A (Call it database B) in SQL SERVER 2008.  I would like to add new records and modified records that occur on database A on serer x to accumulate in database B on server Y so we can have 2 years of data for reporting purposes only.  Having close to real time changes and inserts of new records would be preferred.   <br />
<br />
How can I accomplish this? <br />
<br />
Thanks <br />
Eric</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/sql-language-100/">SQL Language</category>
			<dc:creator>eapranger</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/sql-language/76888-coping-data-db-another-diff-server.html</guid>
		</item>
		<item>
			<title>Implicit conversion error on Alter Column?</title>
			<link>http://p2p.wrox.com/sql-language/76878-implicit-conversion-error-alter-column.html</link>
			<pubDate>Tue, 03 Nov 2009 14:29:48 GMT</pubDate>
			<description>I have code that generates the following SQL statement:
 
ALTER TABLE SurveyResults598 ALTER COLUMN Q13810 REAL
 
Q13810 is currently defined as a...</description>
			<content:encoded><![CDATA[<div>I have code that generates the following SQL statement:<br />
 <br />
<font size="2"><font color="blue">ALTER TABLE SurveyResults598 ALTER COLUMN Q13810 REAL<br />
</font></font> <br />
Q13810 is currently defined as a DATETIME column.  I accept that data is likely to be lost or rendered useless but I still need to change the column from a DATETIME type to a REAL type.  When I run it, I get this error:<br />
 <br />
<font size="2"><font color="red">Implicit conversion from data type datetime to real is not allowed. Use the CONVERT function to run this query.<br />
</font></font> <br />
Note that I am able to successfully convert REAL to DATETIME without causing this error.  And I can go both directions between VARCHAR and REAL.  Only DATETIME to REAL is causing this.<br />
 <br />
So, how do I specify a conversion such as this error suggests to change a column DATA TYPE from DATETIME to REAL?</div>

]]></content:encoded>
			<category domain="http://p2p.wrox.com/sql-language-100/">SQL Language</category>
			<dc:creator>Ron Howerton</dc:creator>
			<guid isPermaLink="true">http://p2p.wrox.com/sql-language/76878-implicit-conversion-error-alter-column.html</guid>
		</item>
	</channel>
</rss>
