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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table A holds sort order for Table B

Status
Not open for further replies.

RWunder

Programmer
Oct 30, 2001
4
US
I have 2 tables, one that I will select a set of records and the other table that holds the sort order for the selected records.

Table A:
UniqueID int
OwnerID int
RowID var
Description var
HelpText var

Table B:
UniqueID int
UniqueRow var
SortOrder var

A.RowID = B.UniqueRow

I want to select specific A.OwnerID records and sort that collection by B.SortOrder Acending.

There has to be a simple select statment to do this...
 
Solved it:


SELECT A.* FROM A INNER JOIN B ON A.RowID=B.UniqueRow WHERE A.MenuID = '$vSMenu' AND A.PageID = '$vSPage' ORDER BY B.Sort ASC, A.DropMenu ASC, A.Sort ASC"

The extra variables and stuff are from the actual code I used to complete my select but the basic syntax is what worked for my problem.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top