ram
ram

Reputation: 1

How to concatenate two table to on table with dropdown?

I want to concatenate this two table to one tabel. year and month, in dropdown. Is it like

year-month
0-1
1-2
1-3

Is it possible to do it in mysql query.

Upvotes: 0

Views: 151

Answers (2)

Fluffeh
Fluffeh

Reputation: 33502

You mean like this?

select concat(a.yearNo,'-',b.monthNo) as yearMonth from table1 a, table2 b where a.someID=b.someID

Upvotes: 0

Peon
Peon

Reputation: 8020

SELECT
  CONCAT( a.year, '-', b.month ) AS year_month
FROM
  year_table a,
  month_table b;

Upvotes: 2

Related Questions