Hey guys,
Recently I got a project where I have to display some results of products taken from a mssql database.
What is the difficult thing for me is that this company's table structure is a little odd. Instead of keeping their products into one table and using one to many or one to one relationships they have 7 tables called products1 to products7 where they store their products.
Now, what I have to display, is the product's code, name, price and quantinty which is fairly easy but the thing is I want to do it using one query. Why I'm saying that?
Each table's structure is identical; each table has a unique id, product's code, name, price, vat, and quantinty columns; and for me to use a single query there has to be a field where all the tables will have a common value, say web_active to yes. I can't do that cause as you may realize each column has it's own value and I can't change the table structure of the company's database it was said to me from the start. What I did was to make 7 identical queries, one for each table.
Now my question is if there's a way to make a single query for all the tables so I can display the data correctly?