Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

MySQL query multiple tables?

I have multiple tables in my database and I would like to sort data based on those tables. It is so that I can add bands and their show dates for friends of mine for shows I am going to. Table one holds: id, band_name, website Table two holds: id, band_id, date, venue, city, state

I want to export to xml so I want it to display:

Band Name

Date Venue City State

Date Venue City State

Band Name

ETC.

2 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    select * from bands left join dates on (bands.bandId = dates.bandId) order by dates.date

    "on (bands.bandId = dates.bandId) "

    is the same as

    "using (bandId)"

  • 1 decade ago

    standard sql would be something like

    select band_name, date, venue, city, state from table1, table2 where

    table1.id=table2.band_id order by date

Still have questions? Get your answers by asking now.