You are viewing a single comment's thread from:

RE: SQL Beginner's Tutorial: JOIN Me and Together We Will Rule the Universe

In reference to my SchoolChildren table this wouldn't happen because there's no actual username field, there's an id field which is a unique integer and first- and last-name fields.

If, by chance, you had multiple kids in the same class with the same first and last name and you were trying to find out how many "multiples" you have, you could do the following:

SELECT DISTINCT COUNT() AS child_duplicate_count, first_name, last_name
FROM schoolchildren
GROUP BY first_name, last_name
HAVING COUNT(
) > 1

You will notice that there are components of this query that I have not went over yet in my lessons, so this is like you're reading ahead in your textbook.

Thanks to this question, I'll be trying to put that in my next tutorial.

Sort:  

Wao, this is great!! I really admire you. If I have any questions will let you know. Keep it up @dbzfan4awhile

Coin Marketplace

STEEM 0.18
TRX 0.16
JST 0.029
BTC 76530.78
ETH 3054.36
USDT 1.00
SBD 2.63