Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

are these two sql same?

Status
Not open for further replies.

wolf73

Programmer
Feb 12, 2006
93
CA
Are inner joins just regular joins? will these two SQL then the same? and will produce same results


SELECT field_mappings.id AS field_mapping_id, internal_fields.id AS internal_field_id, external_fields.id AS external_field_id, internal_fields.field_name AS static_name, external_fields.field_name AS static_value
FROM field_mappings, external_fields, internal_fields
WHERE
internal_fields.id = field_mappings.id
and external_fields.id = field_mappings.id
and internal_fields.id =134
LIMIT 0 , 30




SELECT field_mappings.id AS field_mapping_id, internal_fields.id AS internal_field_id, external_fields.id AS external_field_id, internal_fields.field_name AS static_name, external_fields.field_name AS static_value
FROM field_mappings
INNER JOIN internal_fields ON internal_fields.id = field_mappings.id
INNER JOIN external_fields ON external_fields.id = field_mappings.id
WHERE internal_fields.id =134
LIMIT 0 , 30

 
yep, the same

you should really get used to using JOIN syntax rather than the old comma-delimited table list syntax (i wouldn't exactly call it "regular" but you know what i mean)

for one thing, it's pretty hard (hint: not possible) in mysql to write an outer join without using JOIN syntax, so you might as well get used to it

:)

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top