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
 How to use Union

Author  Topic 

Swatig
Starting Member

7 Posts

Posted - 2008-07-14 : 13:51:02
Hi
I am working on query where need to get results from 2 tables.The query I am using is this :

select m.user_name,p.photo from user_master m,user_profiles p
where m.user_id in
(select user_id from user_profiles p where full_name in
(select full_name from user_profiles where date_of_birth in
(select date_of_birth from user_profiles where date_of_birth in
(select date_of_birth from user_profiles p where
user_name in(select user_name from user_master
where user_name like 's%')))));


if I run this querry seperately this will work
athor wise
its shows 0 row fetch

how can I use union in this querry?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-07-14 : 14:00:17
is this what you want?
select m.user_name,p.photo from user_master m
join user_profiles p
on p.user_id=m.user_id
join user_master m1
on m1.user_name=p.user_name
where m1.user_name like 's%'
Go to Top of Page
   

- Advertisement -