Skip to content

Tag: relational-division

How to get common value based on a column from a table sql

I have a table. the screenshot is given bellow: There have two columns item_details_id pay_method_id In item_details_id there have 1,2,1 data. On the other hand pay_method_id have 1,1,3 data. I want to get only common values of pay_method_id depending on item_details_id. According to the given screenshot- in item_details_id I have ‘1’ & ‘2’ value. —– ‘1’ pay_method_id is ‘1’, ‘3’

SQL Select where column IN inclusive

I have two tables Person and Skill. I have a join table: I have two rows in the Person table And Four rows in the Skill table And the Join table has I want to get a list of all people that have English, Math and Science as a skill (inclusive). A standard select will retrieve both Bob and John.