SQL and sort order

Steve Albin steve at steve-albin.com
Thu Mar 2 08:30:14 CST 2006


Is there any correlation between the order of requested fields in the SQL and the ORDER BY claus?

I have this SQL:

select ax.*, artists.*,  players.* from ax, artists,  players 
where  players.nSessid = 1 and 
Players.nAxId = Ax.nId and 
players.nartid = artists.nid  
order by ax.nAxSort, Artists.nameidx, artists.nid

The ax.nSortOrd sorts correctly using this.

If I change the SQL to this:

select artists.*,  ax.*, players.* from ax, artists,  players 
where  players.nSessid = 1 and 
Players.nAxId = Ax.nId and 
players.nartid = artists.nid  
order by ax.nAxSort, Artists.nameidx, artists.nid

where artists fields come before ax, then the cursor does not sort correctly on ax.nSortOrd.

This is using Valentina 2.2 and RB2006 on the Mac.  

I will put a sample on Mantis, but I first wanted to make sure I didn't have some dumb SQL misunderstanding.


Steve

--
Steve Albin - Montclair, NJ
http://www.jazzdiscography.com/
http://www.steve-albin.com/


More information about the Valentina mailing list