Hi,
Im trying to make a query that need to search throught a table and have to
search different terms, and SUM their Rank (is for a small search engine I
have to design), this is the table:
Table Indexes
ID bigint
ID_Termino -bigint
Rank double
Table Terminos
ID_Termino bigint Primary key
Termino Varchar(50)
Table productos
ID bigint
prod_descripcion varchar(255)
I have another engine that search throught text and apply a Rank to each
word and store it on table indexes and if this word doesnt exist it store
it in table terminus and the id of this word is related in indexes table.
Indexes is related with another table called productos that is the one that
is analyzed by my engine. When any client ask to me for search computer
intel y search with the next query, but the results arent 100% good
because I have to use a clause OR in termino, but I want to use there
something like an and (something like indexes.id=productos.prod_id and
indexes.id_termino=terminos.id_termino and termino="computer" and
termino=intel I know that is impossible, but maybe there is another way to
make that).
SELECT STRAIGHT_JOIN
terminos.id_termino,productos.prod_descripcion,indexes.id,terminos.termino,s
um(indexes.rank) as ordenate,productos.prod_unitel_id FROM
terminos,indexes,productos where indexes.id=productos.prod_id and
indexes.id_termino=terminos.id_termino and termino="computer" or
indexes.id=productos.prod_id and indexes.id_termino=terminos.id_termino and
termino="intel" group by (indexes.id) order by ordenate desc
Thanks for all and best regards,
Roberto
Attachment: [text/html]
Attachment: [text/html]
Attachment: [text/html]