shurix Posted February 19, 2012 Report Share Posted February 19, 2012 Ir 3 tabulas. Viena kurā glabājas bildes(id, bilde), otra kurā glabājas keywordi(id, word, count) un trešā, kas sasaista abas kopā (id, bid, kid) Nevaru izdomāt kāds varētu būt query, lai varētu meklēt pēc atslēgas vārda un izvadīt visas bildes? Quote Link to comment Share on other sites More sharing options...
briedis Posted February 19, 2012 Report Share Posted February 19, 2012 Izmanto JOIN'u SELECT b.* FROM keywords k LEFT JOIN starptabula s ON s.kid = k.kid LEFT JOIN bildes b ON b.id = s.bid WHERE k.word = ... Quote Link to comment Share on other sites More sharing options...
shurix Posted February 19, 2012 Author Report Share Posted February 19, 2012 (edited) Paldies Lai nav jātaisa jauns topiks vēl viens mazs jautājums Kā varētu noselektot 3 bildes atpakaļ un 3 bildes uz priekšu no pašreizējās bildes? Id neiet pēc kārtas. Edited February 19, 2012 by shurix Quote Link to comment Share on other sites More sharing options...
aika Posted February 20, 2012 Report Share Posted February 20, 2012 bez normāla ID nebūs tik viegli. IMHO Uztaisi pilnu selektu, sadzen arajā, arajā atrodi atbilstošam value key un tad attiecīgi ņem +/- aray vērtības. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.