mysql - SQL - Select All rows with Value X when a Row has Value Y -


i trying data row, rows data row.

my table this:

invoice    desc          item_code     units     price     amount 1000       phase       45            10        20        200 1000       bolts         16            45        1         45 1000       jerry         10            1         100       100 1001       phase b       19            10        5         50 

i want return rows whatever in invoice when desc phase a.

i know enough write:

select  invoice, desc, item_code, units, price, amount tbl desc '%phase a%' 

this return row containing phase - want every row of phase below:

1000       phase       45            10        20        200 1000       bolts         16            45        1         45 1000       jerry         10            1         100       100 

i feel should in in statement, or need append in statement, don't know should go.

i feel should in in statement, or need append in statement, don't know should go.

here

select invoice,        desc,        item_code,        units,        price,        amount   tbl  invoice in (select invoice                      tbl                     desc '%phase a%')  

Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -