Table a:
field1 field2
x1 x1
Table b:
field 1
x1
How would I select on table b where field1 = to field 1 of table a?
What if the name of table b is field1 of table a, what is the syntax to perform the join as the selected table being a.field1
This is the actual query I am using:
mysql_query("SELECT * FROM tags WHERE id3='$value' AND flag!='w' AND visibility='t' JOIN tags.albumid WHERE photoid=tags.photoid AND visibility!='d' ORDER BY datetimep DESC LIMIT 200");
Depending on how complex your task is, you can either simply connect rows that have the same value:
or use joins:
In the first case you might have to filter again using the
Distinctkey word if you want to avoid multiple rows containing the same dataAs for joins, there are different types. See eggyal’s link.