|
Posted by --CELKO-- on 02/27/07 20:09
Let me be the bad guy -- I have practice -- and elaborate on Ed's
remark.
>> MyTable {field1, field2, startdate, enddate} <<
is useless. Ignoring the bad column and table names, ignoring the
confusion of columns with fields implied by your bad choices, this
could be any of the following:
CREATE TABLE MyTable
(field1 ?? DEFAULT ?? [NOT NULL]
[CHECK (??)],
field2 ?? DEFAULT ?? [NOT NULL]
[CHECK (??)],
start_date DATETIME [NOT NULL],
end_date DATETIME [NOT NULL],
[CHECK (start_date [< | <=] end_date)
[PRIMARY KEY (??)] );
Do you see how many tens of thousands of possible schemas we have to
filter thru because you do not know how to post a spec? If you want
us to do your homework or your job for you, then at least give us a
spec!!
"[I need] Data! Data! Data! I can't make bricks without clay."
-- Sherlock Holmes (fictional detective of author Sir Arthur Conan
Doyle)
Oh, the use of CASE inside aggregate functions is a standard SQL-92
programming trick which you will find useful. Look at the new OLAP
functions which can also be passed to an aggregate -- a trick most SQL
programmers do no tyet know.
[Back to original message]
|