473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Getting mutliple values from mutliple tables

36
There are two table from which i want to get value
1. heads
2.subheads


The field name in heads table is:

id, head_name.


the field name in subheads table is:
id,subhead_name.



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 `head_name.id` = '1' AND `subhead_name` = '1
'
Oct 29 '11 #1
2 1243
Rabbit
12,516 Expert Mod 8TB
So there's no question then?
Oct 30 '11 #2
adriancs
122 100+
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

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

Similar topics

0
by: Thomas Hansen | last post by:
When I access an Oracle database I can successfully select rows from a database table. So at least one table must exist. But when I try to access the MetaData with getTables() I get no data. Why? ...
13
by: Neal | last post by:
I've got 2 tables. One, I manually insert data into for HTTP authentication. It has 3 fields: username, password, school. Once the user enters the corrrect u and p, the school name shows up hard...
37
by: MLH | last post by:
For example: Nz(,0) returns "300" if the value in field is 300 (currency data type) and "0" if the value is zero or null. I get strings in the query output - they are all left aligned and I...
1
by: Oleg Shnayderman | last post by:
Hi All, I am very new to C# as well as to SQL. I need to write an application which is connecting to SQL DB and getting all the user's tables and after create a dataset for all the tables in the...
0
by: mrwoopey | last post by:
I did not see code for getting all values from a repeater control posted anywhere. So, I figured it out and I am posting for the next person that may need it (sorry if this seems obvious to you): ...
0
by: Anil Kumar Lakky Reddy | last post by:
I have seen lots of people complaining about not getting updated values from edit columns of datagrid. I had similar problem, I figured I was refreshing the data on each page load. I fixed it by...
0
by: Sandy | last post by:
I have four related tables. I need to do an insert on three of them. I created a stored procedure that handles the insert on two of the tables correctly . . . then I get to a tough part. The...
1
by: halyal | last post by:
what is the easiest way for applying defa values for tables from 1 db to another
0
by: bkelly1977 | last post by:
Hi all, I am trying to create a program in VB.NET that will go through the system tables of an SQL Server 2000 database and recreate it. I am making good progress but I have a couple of...
7
by: Peter Gray | last post by:
I have a function that calculates 10 pairs of values (x,y co-ordinates of a graph). I want to use these to calculate the area under the curve.Although I can plot the graph, I do not know how I get to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.