Link to home
Create AccountLog in
Avatar of Shaun Wingrin
Shaun WingrinFlag for South Africa

asked on

MySQL Order by Value in Table

Say, I've 2 tables.
t1 has columns RowPos and ItemCode. RowPos is an int
t2 has only column ItemCode
I wish to select * from t2 and ORDER ASCENDING by RowPos in t1

Database is MySQL
Tx.
Avatar of Cornelia Yoder
Cornelia Yoder
Flag of United States of America image

SELECT t2.* FROM t1, t2 WHERE t1.ItemCode = t2.ItemCode ORDER BY by t1.RowPos
ASKER CERTIFIED SOLUTION
Avatar of edtechdba
edtechdba
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of Shaun Wingrin

ASKER

all item codes in t1 are not in t2