472,811 Members | 5,153 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,811 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 1552
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>...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.