Ishan Jain
Ishan Jain

Reputation: 8161

How to count result-row of a distinct query?

I want to count resulted row of this query - Select Distinct JobURL From TblJobs

When execute this query it's return 50 row. For count the resulted record row I used this query -

Select Distinct Count(JobURL) AS RowIndex From TblJobs, but it's give me result 450

I don't want this output I want 50.

Note : Table TblJobs have total 450 records.

How can I count resulted row number?

Upvotes: 0

Views: 76

Answers (2)

wilx
wilx

Reputation: 18228

Use COUNT(DISTINCT JobURL) instead.

Upvotes: 2

glautrou
glautrou

Reputation: 3198

select JobURL, count(*)
from TblJobs
group by JobURL;

Or:

select count(distinct JobURL)
from TblJobs;

Upvotes: 2

Related Questions