Hello,I need some info, that is it possible to find or make query ,that if we know the data stored in a table but don't know the field name in which the required data is stored.ExampleTable having fields like columnA, columnB, columnC, columnD,..........columnN and all have the same dataType. and you dont know in which field your data exists.suppose some data like e.g. "BackMan" exists in any Field of the table but we don't know in which Field this information is store.Is it possible that we can make a query to search the dataUmair Tariq

Questions by umair_mughal

Showing Answers 1 - 1 of 1 Answers

Guna Sagar Challa

  • Mar 27th, 2006
 

Hi Umar,

It is possible in the follwing way if u atleast know the column names where u r searching for the value

SELECT <Col1,......Coln>

FROM <Tab1>

WHERE 'Backman' in (Col1, Col2,Col3...Coln);

It is even possible without even knowing the column names of the table atleast u know the table name. If u want to know the same feel free to email me back on gunasagarchalla@yahoo.com or for any other clarifications.

Guna Sagar Challa

RoulRaj

  • May 11th, 2007
 

Hello Guna Sagar,

Please give one example i.e without knowing the column name one can write a query.

Regards
Roul

  Was this answer useful?  Yes

Chinmay

  • Jun 27th, 2007
 

Yes,

you can do by
using like with or


like
select * from tab1
where col1 like '%back%'
 or col2 like '%back%'
or col3 like '%back%'
or col4 like '%back%'


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions