• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Help with SQL

New Here ,
Dec 08, 2006 Dec 08, 2006

Copy link to clipboard

Copied

Hi everyone, I have been trying to figure this out all day and nothing seems to work. So this is the situation, I have a site that will have multiple tables for each product category, this was done because I am useing a script to upload xls docs and insert them into the DB, anyhow I want to creat a search for the site. My problem is how would I be able to search all the tables and return the results?

So I have table1 - 5 right each one needs to be searched for keyword of say "gem stone" and then return the results Im assuming with one query. I have tried to do Full join, Unions etc but none of them seem to work right. I had some success with Full Join but when I tried to add in additional tables it crapped out on me. I don't need a where clase just need to grab the records in a view them query it from the code. I guess my real question is what should I use to do this?

Once I know what way to approch it I think I should be fine but for the life of me I cant get it working

Thanks for any help you all can give
TOPICS
Advanced techniques

Views

230

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 08, 2006 Dec 08, 2006

Copy link to clipboard

Copied

Unions should work. Make sure that the field names and data types match
between tables, otherwise you may have to do some creative SQL to add
emtpy fields to some tables and modify data types for others.


proxim00 wrote:
> Hi everyone, I have been trying to figure this out all day and nothing seems to
> work. So this is the situation, I have a site that will have multiple tables
> for each product category, this was done because I am useing a script to upload
> xls docs and insert them into the DB, anyhow I want to creat a search for the
> site. My problem is how would I be able to search all the tables and return the
> results?
>
> So I have table1 - 5 right each one needs to be searched for keyword of say
> "gem stone" and then return the results Im assuming with one query. I have
> tried to do Full join, Unions etc but none of them seem to work right. I had
> some success with Full Join but when I tried to add in additional tables it
> crapped out on me. I don't need a where clase just need to grab the records in
> a view them query it from the code. I guess my real question is what should I
> use to do this?
>
> Once I know what way to approch it I think I should be fine but for the life
> of me I cant get it working
>
> Thanks for any help you all can give
>
>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 08, 2006 Dec 08, 2006

Copy link to clipboard

Copied

LATEST
Thanks Carl! I created a I used UNION ALL and it worked like a charm 🙂 funny how sometimes you need to take a step back ask a question and then what do you know it works lol

Thanks again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation