mercredi 29 avril 2015

Getting row value from DB by matching two column using Rails 3

I have a table like below structure.

table name users

id  Receipt_No   type   v_amount    v_date      c_date      v_name    v_status

7    150325006   SWD     60.00     2015-04-15  2015-04-28   Deepak    No

8    150325006   GOODS   1195.00   2015-04-15  2015-04-28   Deepak    No

9    150325006   BURNING  290.00   2015-04-15  2015-04-28  Deep       No

10   150325006   BURNING  290.00   2015-04-15   2015-04-15  Deep      No

I know only v_catagory and v_name column value.Suppose i have v_catagory="Deep" and v_name="BURNING" information.I need all row value whose v_name ="Deep" and v_catagory="BURNING" and finally display all required value in a table that means id no-9.10 should display in a table.Please help me.

Aucun commentaire:

Enregistrer un commentaire