php - Mysql query error when trying to extract from two different tables with where clause -


i not able retrieve query result when trying extract data 2 different table column data matches(b/w column of first table , column of second table)

i used following 2 methods:

 select a.*, `table1` a, `table2` b  a.`synonyms` in (b.`synonyms`); 

or

select a.*, `table1` a, `table2` b a.`synonyms`=b.`synonyms`; 

and

select * `table1` `synonyms` in (select `synonyms`from `table2`where 1); 

first query showing error:

#1064 - have error in sql syntax; check manual corresponds mysql server version right syntax use near 'from `table1` a, `table2` b  where' @ line 1 

second query running long time , @ end displaying nothing except: show query.

what mistake making here?

ps: tabel1 , table both having synonyms column (value of synonym in varchar). around 300k synonyms(eg:gene name) there in table1. table2 have around 5000 synonyms exsist in table1. want extract 5000 table1 information contain.

    select * `table1` `synonyms` in ('synonym1','synonym2','synonym3','synonym4');  

change

 select a.*, 

to

select a.* 

plus use join in query like

select a.* `table1` join `table2` b on (a.synonyms=b.synonyms); 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -