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
 General SQL Server Forums
 New to SQL Server Programming
 SQL Query

Author  Topic 

dhinasql
Posting Yak Master

195 Posts

Posted - 2008-03-07 : 10:46:04
Hi Friends,

I Have a Query in this SQL Query I want to check the delete field is should be 0

SELECT ut.TypeName Usertype , COUNT(u.UserTypeID) Number FROM lkusertype AS ut LEFT JOIN Usermgmt AS u ON u.UserTypeID = ut.TypeID GROUP BY ut.TypeID, ut.Typename

Here i want to use where ut.deleted=0

Please help me to modify this query

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-03-07 : 10:49:52
[code]
SELECT ut.TypeName Usertype ,COUNT(u.UserTypeID) Number
FROM
(select * from lkusertype where deleted=0) AS ut LEFT JOIN Usermgmt AS u
ON u.UserTypeID = ut.TypeID GROUP BY ut.TypeID, ut.Typename[/code]

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -