Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 using sub-query instead of table merge

Author  Topic 

gozlemci
Starting Member

2 Posts

Posted - 2011-03-30 : 15:16:45
Hi There;
I wonder an answer of question. What can be the reasons for using sub-query instead of merging table? Can you give an example?

Thanks in advance.

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2011-03-30 : 16:58:55
Can you describe what a merging table is?

I've not heard the term before, so I wanted to make sure we are all on the same page.
Go to Top of Page

gozlemci
Starting Member

2 Posts

Posted - 2011-03-31 : 03:38:42
I mean JOIN operation. Especially INNER JOIN.See the example below:

-----------------
- books -
-------------------
- books_no (PK)-
- book_name -
- category_no (FK)-
-------------------

-------------------
- categories -
-------------------
- category_no (PK)-
- category_desc -
-------------------

SELECT books.book_name, categories.category_desc
FROM books INNER JOIN categories
ON books.category_no = categories.category_no
Go to Top of Page
   

- Advertisement -