php - SQL select items from one table with conditions from another -


i have 2 tables:

accounts(id, name, adress, type)  holidays(name, startdate, enddate) 

and type column accounts set("manager","director","administrator") example.

the name column both colums relationed. when creates holiday, name table holidays name account logged in.

and want know if it's possible make sql statement can take of table 2 the table1.type need "director" , table1.name needs on holidays.

select * accounts a, holidays h a.name = h.name , a.type = 'director'  

this should entries want. it's important link a.name h.name ensure right combination.


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -