Jump to content

How to count records from different tables

Recommended Posts

So I'm trying to filter some records out of my select inside a form on my website.
Problem is that I currently have this setup:


I'm trying to filter time by checking how many records show up of number in table2 
So basically I select time from table1 where number is less than <some amount> in table2

How do I actually put that in sql? I currently have this  but it isn't working:

    SELECT Time FROM Showcase WHERE  Number IN (SELECT COUNT(Number) 
    FROM Build WHERE COUNT(Number) < 50);

it currently doesn't end up with anything but in theory it should show the times from the records where the count of the value of number is less than 50

so if Number = 40 and it gets counted 70 times it shouldn't show up.

but if Number = 30 is counted 29 times it should show up

can anyone tell me what is going wrong?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...