On Tue, Sep 22, 2015 at 3:15 PM, ChingChang Hsiao < ChingChang.Hsiao at overturenetworks.com> wrote:
> > > select * from service_table a,service_fib_table b where > a.service_no=b.service_no; > > In this statement, the entry of service_fib_table must be existing to get > the service_table and service_fib_table data. > > How can I write in one statement to get the service_table data no matter > what the entry of service_fib_table is existing or not. > > ChingChang > ?I am unsure of what you want, but it sounds like you want an OUTER JOIN. Something like: SELECT * FROM service_table AS a LEFT JOIN service_fib_table AS b WHERE a.service_no = b.service_no ; In the above, if there is a row in service_table which does not have a matching row in service_fib_table, then the data in service_table row(s) will be selected and the columns whose values would have come from service_fib_table will have a value of NULL.? -- Schrodinger's backup: The condition of any backup is unknown until a restore is attempted. Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be. He's about as useful as a wax frying pan. 10 to the 12th power microphones = 1 Megaphone Maranatha! <>< John McKown