-1

I have the following structure for a table name check_phone what i want to select the column name from table where specific field (company) of table is equal to 468

calling_nmbr ' called_nmbr'call_type'site_area'company'province'district'region 'called_ims

 779876542    ' +9370098765'   12    '    112  ' 77    ' 12     '   34   ' NULL  '  NULL   

+93799543534  ' +9378843543' missed  '  Kabul  '  98   ' London '  NULL ' 0234  '  NULL    

+93773454654 '+0379923432'  NULL    '  NULL   ' 77    ' Herat  ' NULL   ' NULL ' 233      

+93799435435 '  NULL     '  NULL    '   XY    '  98   '  NULL'  NULL '  945  'NULL     

Note: company field has always data which is the code of company. Some company has distinct field that is not existed for other company but at least all of company has some common field so what i want to get is the name of common fields.

I want to has MySQL equivalent intersect operator between selection of first company columns name and the second company columns name.

luchaninov
  • 6,792
  • 6
  • 60
  • 75

1 Answers1

0

Column name can be accessed using metadata details from db connection. From the table i can see that there is a specific column name company from where you can get company code as other column contais different information.

If you still want to know name of the column based on content of it then get please refer this

Java - How to get Column name on Result Set

Community
  • 1
  • 1
Dr. Vijay
  • 37
  • 5
  • Yeah i can get the column name of table, but now i want to take those fields name that has value for both company – Mohammad Reza Yousufi Apr 15 '14 at 11:43
  • can you please write example of output you want because for me column name and field name are same – Dr. Vijay Apr 15 '14 at 11:52
  • the above table schema is the brief of my table in real my table has allot of fields here i should take the name clling_nmbr, and clled_nmbr because for this two company is common or the intersect result of between company should be that two field – Mohammad Reza Yousufi Apr 15 '14 at 11:55