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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Quick question!
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

3 Posts

Posted - 12/06/2012 :  04:18:03  Show Profile  Reply with Quote
I have a question how to do this but completely in mySQL. In PHP I would do something like this.

foreach($stores as $store)
   //and query the different table and let it join in an array
   $query = 'SELECT * FROM different_table WHERE postcode='.$store->postcode;


I tried it already in SQL.

SELECT as place_id, c.title,, d.postcode_from 
FROM data_different d
INNER JOIN (SELECT id,title,city, postcode FROM data_places WHERE uid=3 AND hidden=0 AND deleted=0) c
ON c.postcode = d.postcode_from
ORDER BY d.postcode_from ASC
LIMIT 1000

But it doesn't work completely. It does join the table but only partially.

Could anybody fix this?

Flowing Fount of Yak Knowledge

2242 Posts

Posted - 12/06/2012 :  04:26:24  Show Profile  Reply with Quote
This is SQL Server related forum.. You can get quick response by posting your query in

Go to Top of Page

Starting Member

1 Posts

Posted - 12/06/2012 :  08:39:23  Show Profile  Reply with Quote

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000