Count as a computed column

I need two columns from a table & I need one computed column of count() Ex: Employee table

 Emmployeeid     LastName      
 1                Level
 2                Target
 3                David

This is the table. I need the result 3 columns. These 2 columns & third computed column consists of no. of e. Answer should be like below

 Ans:Employeeid   Lastname   countof'e'
       1           Level      2
       2           Target     1
       3            David     0

How can I write T-SQL query for this. Thanks.

more ▼

asked May 15, 2013 at 07:54 PM in Default

avatar image

0 1 1 1

(comments are locked)
10|1200 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: May 15, 2013 at 07:54 PM

Seen: 851 times

Last Updated: May 15, 2013 at 09:09 PM

Copyright 2018 Redgate Software. Privacy Policy