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
 Query Help i really need help

Author  Topic 

niba10
Starting Member

1 Post

Posted - 2012-01-27 : 10:09:07
I Have a database with students and teachers
now there is some teacher who educator of some students and i need to display all of the educators wich live in the same city so i tried somthing like this :

SELECT s.shem_st
FROM students AS s
WHERE s.city = (SELECT t.city FROM teachers AS t, mechanech AS m WHERE s.class = m.class AND m.mechanech = t.cod_more)

why its not working what wrong at this query?



xxx

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-01-27 : 10:47:03
so how should be your output?

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

Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-01-27 : 10:54:38
Post the DDL of the tables and some sample data in DML form and the expected result set

read the hint link in my sig


Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -