EasyUI Forum
May 04, 2024, 01:33:49 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How display Datagrid two different column value joining with same Master table  (Read 2958 times)
Naresh Mehta
Newbie
*
Posts: 8


View Profile Email
« on: April 23, 2019, 10:45:16 PM »

I have tabel Details table contain field1 and field2 both having value of Master table id and text, now how display this value in datagrid.

e,g

Master Table               Details Table                                  Result Need in Datagrid
Id           Text              Field1       Field2

1            John                 1             2                                 John          Embross       
2            Embross           2             1                                 Embross     John 
3            Peter                3             1                                 Peter          John       

if I have change in select command pls. help me
my sql is select * from details where field1= id and field2 = id but it is not giving me any value.


Naresh

   
Logged
thecyberzone
Full Member
***
Posts: 176



View Profile Email
« Reply #1 on: April 30, 2019, 04:40:04 AM »

Just use following sql as query ...

select b.Text as field1detail,c.Text as field2detail from Details a
left join Master b on a.field1 = b.Id
left join Master c on a.field2 = c.Id

Have a check.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!