Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8493301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:58:00+00:00 2026-06-10T22:58:00+00:00

Theres my two tables: mysql> desc riddims; +—————+————–+——+—–+——————-+——-+ | Field | Type | Null

  • 0

Theres my two tables:

mysql> desc riddims;
+---------------+--------------+------+-----+-------------------+-------+
| Field         | Type         | Null | Key | Default           | Extra |
+---------------+--------------+------+-----+-------------------+-------+
| riddim        | varchar(255) | NO   | MUL | NULL              |       |
| genre         | varchar(9)   | NO   |     | NULL              |       |
| youtube       | varchar(11)  | NO   |     | NULL              |       |
| image         | varchar(11)  | NO   |     | NULL              |       |
| last_modified | timestamp    | NO   |     | CURRENT_TIMESTAMP |       |
+---------------+--------------+------+-----+-------------------+-------+
5 rows in set (0.00 sec)

mysql> desc tunes;
+---------------+--------------+------+-----+-------------------+-------+
| Field         | Type         | Null | Key | Default           | Extra |
+---------------+--------------+------+-----+-------------------+-------+
| riddim        | varchar(255) | NO   | MUL | NULL              |       |
| artist        | varchar(255) | NO   | MUL | NULL              |       |
| tune          | varchar(255) | NO   |     | NULL              |       |
| label         | varchar(255) | NO   |     | NULL              |       |
| producer      | varchar(255) | NO   |     | NULL              |       |
| year          | varchar(4)   | NO   |     | NULL              |       |
| lyrics        | text         | NO   |     | NULL              |       |
| flag          | varchar(12)  | NO   |     | NULL              |       |
| last_modified | timestamp    | YES  |     | CURRENT_TIMESTAMP |       |
+---------------+--------------+------+-----+-------------------+-------+

What I got so far is

SELECT DISTINCT riddim FROM tunes WHERE year = '2012' ORDER BY last_modified DESC LIMIT 20

it prints the last 20 added/modified entries of the ‘riddim’ column. How do I add the proper information about each riddim from the ‘riddims’ table to each row grabbed from table ‘tunes’?

I assume I have to JOIN them somehow using the “riddim” column as this is the “key” that both tables have in common, I just couldn’t figure out yet how it works.

My goal is to print “riddim, year, image, label” of the last 20 riddims entries of this year (using php), where only the ‘tunes’ table holds information about the year and label.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:58:02+00:00Added an answer on June 10, 2026 at 10:58 pm
    SELECT DISTINCT
      tunes.riddim AS riddim,
      tunes.year AS year.
      riddims.image AS image,
      runes.label AS label
    FROM riddims
    INNER JOIN tunes ON riddims.riddim=tunes.riddim
    WHERE tunes.year="2012"
    ORDER BY riddims.last_modified
    LIMIT 20
    ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the follow two mysql tables: mysql> desc subscriptions; +------------+--------------+------+-----+---------+----------------+ | Field |
I have two tables in mysql, both are type InnoDB and there is an
There are two tables: CREATE TABLE STORE ( ID INTEGER NOT NULL, MEDICINE_ID INTEGER
Say, there are two tables. One contains a field with long text values (for
I have two tables in MySQL 5.1.38. products +----+------------+-------+------------+ | id | name |
I have two tables on MySQL, with this structure: Users: id | name Accounts:
I'm trying to use natural join to join two tables in mySQL that have
I have two tables on mysql: users, and management. The users table has a
I have these two tables in MySql: [Person] PersonId NameFirst NameLast [Email] EmailId PersonId
I am trying to SELECT records from two MySql tables. I would like all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.