Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Alias

Author  Topic 

1sqlover
Yak Posting Veteran

56 Posts

Posted - 2006-10-13 : 14:04:53
Is it possible to create an alias (ProductID, COUNT(*) AS PIDCount) and show all ProductID > 25?
Thanks

X002548
Not Just a Number

15586 Posts

Posted - 2006-10-13 : 14:11:46
an alias? Gonna need a little more info

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page

snSQL
Master Smack Fu Yak Hacker

1837 Posts

Posted - 2006-10-13 : 14:12:25
I think you have completely misunderstood the meaning of aliases, read up on them in Books Online. I think you're perhaps meaning that you want a derived table which would use an alias, but in fact this query won't need a derived table.

It will be something like this

SELECT ProductID, count(*)
FROM YourTable
GROUP BY ProductID
HAVING count(*) > 25

Read up on grouping and aggregate functions to learn more.
Go to Top of Page
   

- Advertisement -