Forum Moderators: open
SELECT *
FROM table1, table2
WHERE
table1.col1 = table2.col1 AND
table1.col2 > 21 AND
table1.col2 < 31 AND
(table1.col3 = 'texta' OR table1.col3 = 'textb' OR table1.col3 = 'textc' OR table1.col3 = 'textd' OR table1.col3 = 'texte' ) AND
table2.col2 = 'textf' AND
table1.col4 = 'textg' AND
table1.col5 = 'texti' AND
table1.col6 = 'textj'
SELECT * ,
MATCH (
table2.col3
)
AGAINST (
'some text'
) AS score
FROM table2
WHERE MATCH (
table2.col3
)
AGAINST (
'some text'
)
ORDER BY score DESC
SELECT * ,
MATCH (
a.col3
)
AGAINST (
'some text'
) AS score
FROM (
SELECT *
FROM table1, table2
WHERE
table1.col1 = table2.col1 AND
table1.col2 > 21 AND
table1.col2 < 31 AND
(table1.col3 = 'texta' OR table1.col3 = 'textb' OR table1.col3 = 'textc' OR table1.col3 = 'textd' OR table1.col3 = 'texte' ) AND
table2.col2 = 'textf' AND
table1.col4 = 'textg' AND
table1.col5 = 'texti' AND
table1.col6 = 'textj'
) AS a
WHERE MATCH (
a.col3
)
AGAINST (
'some text'
)
ORDER BY score DESC
SELECT *, MATCH (
table2.col3
)
AGAINST (
'some text'
) AS score
FROM table1, table2
WHERE
table1.col1 = table2.col1 AND
table1.col2 > 21 AND
table1.col2 < 31 AND
(table1.col3 = 'texta' OR table1.col3 = 'textb' OR table1.col3 = 'textc' OR table1.col3 = 'textd' OR table1.col3 = 'texte' ) AND
table2.col2 = 'textf' AND
table1.col4 = 'textg' AND
table1.col5 = 'texti' AND
table1.col6 = 'textj' AND
MATCH (
table2.col3
)
AGAINST (
'some text'
)
ORDER BY score DESC