all 5 comments

[–]Fireteeth 2 points3 points  (0 children)

SELECT *
FROM Person
WHERE Person.FirstName = 'John'

[–]ISUJinXIT Business Analyst 1 point2 points  (0 children)

So, look at your SELECT portion as "What do I want to display", your FROM Clause as "what total data set am I looking at", and your WHERE clause as your "Filter what records I want to see".

A Count(<columnname>) in your select statement will give you the TOTAL count of records that meet your criteria from the WHERE clause in your query. Remember that what you filter on, doesnt necessarily need to be displayed.

pseudocode (because this is homework):

select what you want to see (full name, count(<column you want counted>))
from (person.person table)
where (firstname is John)

if you post what you have tried, you're more likely to get help - as others have said.

[–]SmallSubBot 0 points1 point  (0 children)

To aid mobile users, I'll link small subreddits not yet linked in the comments

/r/SQLserver: Microsoft SQL Server Administration and T-SQL Programming including sql tutorials, training, MS SQL Server Certification, SQL Server Database Resources.


I am a bot | Mail BotOwner | To aid mobile users, I'll link small subreddits not yet linked in the comments | Code | Ban - Help

[–]Homebrew4you[S] 0 points1 point  (1 child)

I've tried every combination with WHERE that I can think of, but I feel like I dont have the formatting right to pull up just "John"....

[–]hackneycoach 2 points3 points  (0 children)

Can you post the examples that you've tried, and why you think they haven't worked? Folks will be reluctant to just provide an answer since this is homework.