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
 SQL Server 2012 Forums
 Transact-SQL (2012)
 How can design a query?

Author  Topic 

Erdal
Starting Member

1 Post

Posted - 2013-03-20 : 05:38:39
tblAddress = City
tblMembers = Name,Relation
tblCase = Case_Number



Case_Number Name Relation City

12345 Ahmet PA Istanbul
12345 Fatma WI Ankara
12345 Ali SO Ankara

How can I find if the 'PA' has different ‘City’ then other members?

Thank you,

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-03-20 : 05:50:18
Amnot getting your requiremnt...
Can you explain the logic clearly?
Post some sample input data and expected output

--
Chandu
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-03-20 : 10:15:52
how are the tables related? your table structure doesnt show any columns to relate

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2013-03-20 : 14:32:35
Generally we like to see ddl, sample data and desired output. You might want to take a few minutes and read the articles below for best practices when posting questions. The concepts covered in there will help greatly when you post more in the future.

http://www.sqlservercentral.com/articles/Best+Practices/61537/
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx
Go to Top of Page
   

- Advertisement -