Request: tablea.tableb_id = tableb.id

mbourgonmbourgon Posts: 32 Bronze 2
edited April 14, 2008 2:13PM in SQL Prompt Previous Versions
We frequently use ID as the key, and reference it in other tables by tablename.id. So store.id would be the referenced in another table as store_id. However, the autojoiner only comes up with tablea.id = tableb.id.

That would be quite handy. Thanks.

Comments

  • How are your tables set to reference each other? If you've set foreign keys then these should be picked up and the joins suggested.

    If you don't have your tables set up in this way then have you tried setting the option 'Listed Candidates' > 'Join Conditions' > 'Data Types'

    This will bring up join conditions based on data type. As long as your id fields share the same data type then the join you want should be selected.
  • mbourgonmbourgon Posts: 32 Bronze 2
    Ben, I'm not using foreign keys for them. I did just try using "data types", but instead of 1 not-useful join, it gives me 30 or 40 not-useful joins along with the 1 useful join.
  • At the moment SQL Prompt won't work exactly as you want in your environment. It will only pick up foreign keys, exact column name matches and matching data types. But I'll add your request as a feature request and depending on how difficult it is to implement and how much call there is for this specific Join type, hopefully the developers will consider implementing this in a future release.
Sign In or Register to comment.