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
 Quick question!

Author  Topic 

rogier.vs
Starting Member

3 Posts

Posted - 2012-12-06 : 04:18:03
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
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2012-12-06 : 04:26:24
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

1 Post

Posted - 2012-12-06 : 08:39:23
thanks

unspammed
Go to Top of Page
   

- Advertisement -