Avatar of universalmonster
universalmonster

asked on 

Select, Count & Join

Hi All,

I'm trying to do what feels like the impossible!! I have a query:
"SELECT * from interviewees";
+------------+-------------+----------------------------+-----+-------------+---------------+
| firstname  | lastname    | emailaddress               | RID | candidateid | interviewdate |
+------------+-------------+----------------------------+-----+-------------+---------------+

Open in new window

I am trying  (in the same query) to count the number of times the "candidateid" for each result appears in table 'timetable' then join the result as "ScheduleCount". As individual queries I can get it to work, but not as one!
select candidateid,Count(*) as schedulecount from timetable group by candidateid order by candidateid;

Open in new window

MySQL ServerDatabases

Avatar of undefined
Last Comment
universalmonster
ASKER CERTIFIED SOLUTION
Avatar of Jose Torres
Jose Torres
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of universalmonster
universalmonster

ASKER

The ISNULL part kept erroring on me, but once removed, it worked a treat! Thank you!!
Databases
Databases

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.

62K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo