How to query a table whose name is derived from another table?
-
I have a SQL database which has a number of tables, I have a table which has the names of all the tables in the database. I first need to derive name of a table from this table and then query that table. So the query is like: SELECT * FROM (SELECT TABLE FROM INDEX_TABLE). Please solve this problem for me as it is really urgent!! Thank you!! I got a project stuck because of this!! And I shall surely put your name on my project and shall personally tell you when it is online!!
-
Answer:
This query can be written in two froms 1. select * from firsttable_name where name in(select name from the secondtable_name where cond2); 2. select * from firsttable_name f,secondtable s where f.name = s.name and other_condition If you have any doubts over this contact me at [email protected]
ron at Yahoo! Answers Visit the source
Related Q & A:
- How to show a table on another page?Best solution by Stack Overflow
- How to query a nested document in mongo?Best solution by Stack Overflow
- How to create a table in PHP with MySQL?Best solution by Stack Overflow
- How to create a table in gmail?Best solution by Web Applications
- How to do a good MSN name?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.