Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/10/2014, 17:02
TutexMdz
 
Fecha de Ingreso: julio-2010
Mensajes: 52
Antigüedad: 14 años, 5 meses
Puntos: 3
De acuerdo consulta fulltext con case y left join da error

Hola Gente, estoy intentando armar un buscador con un indice de tabla por primera vez.

este es el codigo SQL que intento que funcione y me da error. ya indicé la tabla en cuestión si alguien sabe donde esta el problema se lo agradezco desde ya

Código MySQL:
Ver original
  1. SELECT p.*,
  2.     c.name as name_category,
  3.     t.name as name_type,
  4.     cy.name as name_country,
  5.     s.name as name_state,
  6.     l.name as name_locality,
  7.     pf.usertype as usertype_profile,
  8.     pf.name as name_profile,
  9.     pf.logo_image as logo_image_profile,
  10.     CASE WHEN CHAR_LENGTH(p.alias) THEN CONCAT_WS(":", p.id, p.alias) ELSE p.id END as Pslug,
  11.     CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(":", c.id, c.alias) ELSE c.id END as Cslug,
  12.     CASE WHEN CHAR_LENGTH(cy.alias) THEN CONCAT_WS(":", cy.id, cy.alias) ELSE cy.id END as CYslug,
  13.     CASE WHEN CHAR_LENGTH(s.alias) THEN CONCAT_WS(":", s.id, s.alias) ELSE s.id END as Sslug,
  14.     CASE WHEN CHAR_LENGTH(l.alias) THEN CONCAT_WS(":", l.id, l.alias) ELSE l.id END as Lslug,
  15.     CASE WHEN CHAR_LENGTH(t.alias) THEN CONCAT_WS(":", t.id, t.alias) ELSE t.id END as Tslug,
  16.     CASE WHEN CHAR_LENGTH(pf.alias) THEN CONCAT_WS(":", pf.mid, pf.alias) ELSE pf.mid END as Uslug,
  17.     MATCH ( name, description ) AGAINST ( lote venta ) as Score
  18.     FROM tab_productos_products AS p
  19.     LEFT JOIN tab_productos_country AS cy ON cy.id = p.cyid
  20.     LEFT JOIN tab_productos_state AS s ON s.id = p.sid
  21.     LEFT JOIN tab_productos_locality AS l ON l.id = p.lid
  22.     LEFT JOIN tab_productos_profiles AS pf ON pf.mid = p.agent_id
  23.     LEFT JOIN tab_productos_category AS c ON c.id = p.cid
  24.     LEFT JOIN tab_productos_type AS t ON t.id = p.type
  25.     MATCH ( name, description ) AGAINST ( lote venta )
  26.     WHERE p.published = 1
  27.     ORDER BY p.featured DESC, p.listdate DESC, p.id DESC
  28.     LIMIT 0, 10

el error que tira es este:

No valid database connection You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'venta ) as Score FROM tab_productos_products AS p LEFT JOIN alq_properties_cou' at line 5

Gracias