473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Very big table

Hi Expert,
In my DB i have a big table like this:

Primary key | param1 | para2 | param3 | param4 | ... | param100|
------------------+-----------+---------+-----------+------------+----
+--------------+
| | | |
| | |

There is any way to build a parametric "Where" instead of manually
specification for example:

WHERE param1 = Y OR param2 = Y or param3 = Y ... param100 = Y

mybe for example:

WHERE paramx = Y

thanks

Apr 16 '07 #1
2 1559
Alex wrote:
Hi Expert,
In my DB i have a big table like this:

Primary key | param1 | para2 | param3 | param4 | ... | param100|
------------------+-----------+---------+-----------+------------+----
+--------------+
| | | |
| | |
Then I would suggest you stop writing DML and fix the problem:

Primary Key | Parameter ID | Parameter Value

Your report writers, no doubt, will want to draw blood for such
an abominable lack of design.
--
Daniel A. Morgan
University of Washington
da******@x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Apr 16 '07 #2
Alex (al*****@gmail.com) writes:
Hi Expert,
In my DB i have a big table like this:

Primary key | param1 | para2 | param3 | param4 | ... | param100|
------------------+-----------+---------+-----------+------------+----
+--------------+
| | | |
| | |

There is any way to build a parametric "Where" instead of manually
specification for example:

WHERE param1 = Y OR param2 = Y or param3 = Y ... param100 = Y

mybe for example:

WHERE paramx = Y

It is not unlikely that the best design for the table would have been:
CREATE TABLE details (primarykey ....,
paramno tinyint NOT NULL,
value ....,
CONSTRAINT pk_deatils(primarykey, paramno))

In this case the query would be trivial to write.

With the current design, you could generate the code, but in the end
you would need that long chain of ORs one way or another.

Relational databases are simply not meant to be used that way.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Apr 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: robin | last post by:
I need to do a search through about 50 million records, each of which are less than 100 bytes wide. A database is actually too slow for this, so I thought of optimising the data and putting it all...
1
by: David Lawson | last post by:
The line indicated below from my php script is very slow (about 10 seconds). I have this field indexed so I thought that it would be much faster. Could someone tell me what might be wrong? I'm also...
11
by: DJJ | last post by:
I am using the MySQL ODBC 3.51 driver to link three relatively small MySQL tables to a Microsoft Access 2003 database. I am finding that the data from the MySQL tables takes a hell of a long time...
16
by: mamo74 | last post by:
Hello. I am administering a SQL Server (Enterprise Edition on Windows 2003) from some month and can't understand what is going on in the latest week (when the db grow a lot). The DB is around...
8
by: news | last post by:
I seriously doubt this is possible...but you never know, so here goes. Due to bad pre-planning I have a Web page that is VERY table heavy with a very complicated and delicate setup. Any changes...
8
by: York | last post by:
Hi, R language has very high-level IO functions, its read.table can read a total .csv file and recogonize the types of each column. write.table can do the reverse. R's MySQL interface has...
1
by: Avi | last post by:
Hi All. This code works very fine in Firefox but not in I.E. Can anybody help me out? it gives ... "Unknown Runtime Error" in I.E. This code ... Stores N*2 Matrix at Client Side & provide the...
2
by: shsandeep | last post by:
Hi all, I have heard and read this many times: "Partitions should only be used for 'very large' tables". What actually determines whether a table is 'very large' or not? I have tables containing...
6
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID,...
0
by: DotNetFAQ | last post by:
I need to insert rows to a database table after processing a piece of an XML file. The XML file would look something like: <Book> <Chapter> <Page> <Paragraph> <Paragraph> </Page> </Chapter>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.