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
 Fetching Data from tables without using joins

Author  Topic 

PRIYA.CYNTHIA
Starting Member

3 Posts

Posted - 2008-08-29 : 13:34:07
Hi all,

How can we fetch data from more than one table, without using joins??

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-29 : 13:38:54
yup you can. using union all is another method. but it really depends on your requirements. without knowing that its hard to tell.
Go to Top of Page

DavidChel
Constraint Violating Yak Guru

474 Posts

Posted - 2008-08-29 : 14:07:57
Um... don't consider myself an expert but you can use the where clause instead.

select * from TableA, TableB where TableA.field = TableB.field.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-29 : 14:12:13
quote:
Originally posted by DavidChel

Um... don't consider myself an expert but you can use the where clause instead.

select * from TableA, TableB where TableA.field = TableB.field.


you're still using join above. its another way of representing join. its just that syntax is not the ANSI join syntax.
Go to Top of Page

DavidChel
Constraint Violating Yak Guru

474 Posts

Posted - 2008-08-29 : 14:27:09
quote:
Originally posted by visakh16

quote:
Originally posted by DavidChel

Um... don't consider myself an expert but you can use the where clause instead.

select * from TableA, TableB where TableA.field = TableB.field.


you're still using join above. its another way of representing join. its just that syntax is not the ANSI join syntax.



Hence, I prefaced it wtih "don't consider myself an expert".
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-08-29 : 14:34:15
quote:
Originally posted by DavidChel

quote:
Originally posted by visakh16

quote:
Originally posted by DavidChel

Um... don't consider myself an expert but you can use the where clause instead.

select * from TableA, TableB where TableA.field = TableB.field.


you're still using join above. its another way of representing join. its just that syntax is not the ANSI join syntax.



Hence, I prefaced it wtih "don't consider myself an expert".


no worries
you'll shortly become one
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2008-08-29 : 15:06:15
[code]
select * from TableA

select * from TableB
[/code]

CODO ERGO SUM
Go to Top of Page
   

- Advertisement -