View Single Post
Old 06-26-2007, 12:08 AM   #2
Mark Huizer
 
Mark Huizer's Avatar
 
Posts: n/a
My Photos: ()

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Order by column from other table

The wise Pawel Ratajczak enlightened me with:
> Hi,
>
> I'm a beginner in mysql and SQL area.
>
> The problem is that I've got two tables. In the first table some column is
> an ID (int value) in the scond table this ID is mapped on string value.
>
> Is there a way to create query that gets data form the first table and
> orders it according to ID column, but with string values instead of int
> values. Proper strings are taken of course from the second table from rows
> that corresponds to integer ID.?


something like
select * from table1 join table2 using(id) order by table2.stringfield ?

Mark
--
Terantula - Industrial Strength Open Source - http://www.terantula.com/
Projects and administration - +31 6 5140 5160
  Reply With Quote