In mySQL, how do I get the basic aggregates from a table?
mySQL | Explanation | SQL Server |
use enron; select COUNT(*) as counted from recipientinfo; select MIN(rid) as rid_min from recipientinfo; select MAX(rid) as rid_max from recipientinfo; select SUM(rid/10.0) as rid_summed from recipientinfo; select AVG(rid/10.0) as rid_avgd from recipientinfo; |
No real surprises here - they work the same in both places. |
use Enron; go select COUNT(*) as counted from dbo.recipientinfo; select MIN(rid) as rid_min from dbo.recipientinfo; select MAX(rid) as rid_max from dbo.recipientinfo; select SUM(rid/10.0) as rid_summed from dbo.recipientinfo; select AVG(rid/10.0) as rid_avgd from dbo.recipientinfo; |
No comments:
Post a Comment