|
-
Oct 14th, 2001, 09:50 AM
#1
Thread Starter
Member
Can I use sql to get data from different tables?
I currently have:
sql="select data from tablename"
But I need to go to another table and get records with data.
Can this be done or do I need 2 different sql statements??
-
Oct 14th, 2001, 09:52 AM
#2
SELECT Table1.Price, Table2.Location FROM Table1, Table2
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Oct 14th, 2001, 10:35 AM
#3
PowerPoster
It's called "Joining Tables". There's ton's of information out there on this subject.
-
Oct 14th, 2001, 10:40 AM
#4
You can also create a view (a query, depending on the db you're using).
ansi sql view creation:
Create View MyView as select one, two,three from tableA, tableB
where tableA.four = tableB.four;
You then just say:
Select * from MyView;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|