470,591 Members | 2,282 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

Seaching mulitple fields?

Hello,

I need to do a seach in multiple columns for a certain word. With SQL
I have to use one specific column right?

I.E. select * from DB where Column1 like '%search%'

That works.

But what if I want to seach multiple columns in the table for the
search word?

You can't do this:

select * from DB where Column1, Column2, Column3 like '%search%'

Is there a way to do this?

Thanks,

Tmuld.

Jul 23 '05 #1
1 1276
Tmuld,

Try:

SELECT * FROM YourTable
WHERE Column1 LIKE '%search%' OR Column2 LIKE '%search%' ... etc.

-Andy

"Tmuld" <tm******@spliced.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hello,

I need to do a seach in multiple columns for a certain word. With SQL
I have to use one specific column right?

I.E. select * from DB where Column1 like '%search%'

That works.

But what if I want to seach multiple columns in the table for the
search word?

You can't do this:

select * from DB where Column1, Column2, Column3 like '%search%'

Is there a way to do this?

Thanks,

Tmuld.

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ralph Freshour | last post: by
2 posts views Thread by Martin | last post: by
5 posts views Thread by Dave H | last post: by
10 posts views Thread by LittlePython | last post: by
2 posts views Thread by jackson2005 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.