Skip to content

Tag: mysql

Select sum if and having count

I have 3 tables table artist with artist_id, name; table album with album_id, artist_id, name; table songs with song_id, artist_id, album_id, (few more things but I don’t think they are necessary for this problem); I want to select a table with the name of the artist, number of albums with equal or more…

How to select only latest added records avoiding duplicates

I need to select from the table competition_rounds the latest added records which are linked to the competition_seasons table with the season_id column, eg: competition_rounds competition_seasons I want return only: the problem’s that my query return all rounds available: NB: The table competition simpl…