mysql, select, many to many, join tables. ordering by a field -


i have dictionary table: 'kws' [kws.wrd][kws.kwid] (word , unique id) have many many relation in: kwds table [kwds.kwid][kwds.linkid][kwds.weight] (keyword id*, link id*, weight), may keywords , many links, , weight of keyword link page. have links table 'lnks' [lnks.url][lnks.txt][lnks.siteid] have site table 'wss' [wss.siteid][wss.logo][wss.serverip] sql search page is:

select     distinct(lnks.linkid),wss.name,wss.logo,wss.srvip,     lnks.linkid,lnks.title,lnks.dsc,lnks.name,lnks.url,lnks.txt,     lnks.siteid,kwds.wg lnks       join kwds on (kwds.linkid=lnks.linkid , kwds.wg>0)        join kws on (kws.kwid=kwds.kwid)        join wss on (wss.siteid=lnks.linkid)        kws.kwid in (396,416,399) order  kwds.wg limit  0, 8 

where 396,416,399 pre-fetched keywords ids dictionary table 3 variant words criteria. query not order weight. doing wrong.

the real query can seen @ code.google.com/p/mitza @ demo link... 209.* tables using can seen @ same location in sources tab bin sql

thank you.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -