joined query problem
Hi,
I got in database table CATEGORY and table PRICE
CREATE TABLE `price_cat` (
`price_cat_id` INT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
`price_cat_name` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`price_cat_id`)
)
ENGINE=MyISAM
ROW_FORMAT=DEFAULT
---------------------------------------------------
CREATE TABLE `price` (
`price_id` INT(6) UNSIGNED NOT NULL AUTO_INCREMENT,
`price_pricecat` INT(6) UNSIGNED NULL DEFAULT NULL, [here comes the category ID the price_cat_id]
`price_name` VARCHAR(255) NOT NULL DEFAULT '',
`price` FLOAT NOT NULL DEFAULT '0',
PRIMARY KEY (`price_id`)
)
ENGINE=MyISAM
ROW_FORMAT=DEFAULT
How can I do the query to get like this:
<!-- query begin
Category 1 [this is the category from 'price_cat' table]
Chinese TV-s 100 dollar [these are from 'price' table]
English TV-s 100 dollar
Hungarian TV-s 100 dollar
Category 2
Chinese radio 100 dollar
Russian radio 100 dollar
Japanese radio 100 dollar
...
query end -->
Thanx in advanced
Subject
Written By
Posted
joined query problem
May 12, 2010 05:21AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.