By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

Getting mutliple values from mutliple tables

P: 36
There are two table from which i want to get value
1. heads

The field name in heads table is:

id, head_name.

the field name in subheads table is:

i want to get value from these two table when the value mean id is '1'

i wrote the query something like this
Expand|Select|Wrap|Line Numbers
  1. SELECT `head_name`,`subhead_name` FROM `heads`,`subheads` WHERE `` = '1' AND `subhead_name` = '1
Oct 29 '11 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 10K+
P: 12,364
So there's no question then?
Oct 30 '11 #2

P: 122
Expand|Select|Wrap|Line Numbers
  1. SELECT `head_name`,`subhead_name` FROM `heads`,`subheads` WHERE `heads`.`id` = 1 and `subheads`.`id` = 1;
  2. SELECT `head_name`,`subhead_name` FROM `heads`,`subheads` WHERE `heads`.`id` = `subheads`.`id` and `heads`.`id` = 1;
Dec 3 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.