sql - mysql 2 join error on multiple WHERE clause -


i trying call specific information sql table using following statement

select `prop_street`, `prop_price`, `prop_status`, `agt_fname`, `agt_lname` `property`, `agent` property.prop_agent = agent.agt_fname && property.prop_status = ("sold" , "available sale", "under contract");  

as can see, trying call listed sold, available sale , under contract. while try this, getting error operand should contain 1 coulmn happens when trying call more 1 prop_status

this proper syntax you're trying do:

select prop_street, prop_price, prop_status, agt_fname, agt_lname   property p   join agent     on p.prop_agent = a.agt_fname  p.prop_status in ('sold', 'available sale', 'under contract') 

some notes:

  1. join conditions belong in join clause, not clause. although there no functional difference, practice.

  2. && mean "and" in other languages, not sql. have use "and"

  3. use single quotes literals ('), not double quotes (")

  4. use in, not =, when specifying more 1 literal.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -