What are the challenges you face when working across database platforms? Take the survey
Options

Suggestion for a better JOIN

EMoscosoCamEMoscosoCam Posts: 4
edited October 1, 2007 9:35AM in SQL Prompt Previous Versions
Hello

I would like to suggest the following:
1) After JOIN is typed, in top of the list should appear the tables that the main table has foreign keys with.
2) If a table is selected, the join condition should be typed automatically.
3) For the next JOIN, in the list should not appear the table that is already joined.

Thanks a lot.

Comments

  • Options
    Hi. In answer to your questions:

    1) This should already happen in Prompt 3.6. For instance, on Northwind:
    SELECT * FROM [Employees] JOIN
    should list Employes and EmployeeTerritories at the top.
    2) We'll consider this, but I kinda like it the way it is since there are many different JOINs you may wish to do or you may want to join with another table.
    3) We'll consider this, but again this is by design. Self-joins and recursive/self-referencing keys mean that you may wish to join to the table that is already joined.

    Thanks,
    Jason
    Jason Crease
    Red Gate Software
  • Options
    I am using 3.6 and when I typed JOIN the list appear showing all the tables (including those that the main table do not have foreign keys with) sorted by name.

    After I type ON, I would like that the joined table name appears automatically. If I have chosen the PK of the joined table, after I type "=" I would like that the foreign key of the main table is suggested.

    SELECT *
    FROM maintable
    INNER JOIN joinedtable ON joinedtable.PK = maintable.FK

    It would be also nice that when expanding the "*", the duplicated keys should not appear.
Sign In or Register to comment.