SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

rogier.vs
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 c.id as place_id, c.title, c.city, 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?

bandi
Flowing Fount of Yak Knowledge

India
2206 Posts

Posted - 12/06/2012 :  04:26:24  Show Profile  Reply with Quote
Hi,
This is SQL Server related forum.. You can get quick response by posting your query in
http://forums.mysql.com/
http://forums.devshed.com/mysql-help-4/

--
Chandu
Go to Top of Page

chrltnz88ssn
Starting Member

USA
1 Posts

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

unspammed
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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.08 seconds. Powered By: Snitz Forums 2000