for example I have data as found in the table below
tabel order
-----------------------------------------
id_order no_order order_date
-----------------------------------------
1 0000001 12-01-2013
2 0000002 15-01-2013
-----------------------------------------
tabel item_order
--------------------------------------------------
id_item_order id_order order_name
--------------------------------------------------
1 2 Product 1
2 2 Product 2
3 2 Product 3
4 2 Product 4
--------------------------------------------------
then I want to display the data from database with join as below
--------------------------------------------------
id_item_order order_name no_order
--------------------------------------------------
1 Product 1 0000002 A
2 Product 2 0000002 B
3 Product 3 0000002 C
4 Product 4 0000002 D
--------------------------------------------------
how to display the character “A – n” located behind no_order according to the amount of data that relate item_order with id_order in table order?
please help me. thank you
SQL Fiddle for testing