Viewing 15 posts - 1,711 through 1,725 (of 2,171 total)
Lynn is almost there. I think the INNER JOIN should be replaced with a LEFT JOIN, the get all zero counts too.
SELECT
h. N 56°04'39.16"
E 12°55'05.25"
April 6, 2007 at 1:33 pm
Why do everyone expect the DocID to be sequential?
SELECT
t.*
FROM Table1 AS t
WHERE t. N 56°04'39.16"
E 12°55'05.25"
April 6, 2007 at 1:27 pm
(select count(*) .. ) AS [RowNumber]
N 56°04'39.16"
E 12°55'05.25"
April 6, 2007 at 1:23 pm
I think you have to post your eight business rules how to handle all cases with values vs NULL.
Col1 Col2 Col3 Result
---- ---- ---- ------
5 5 5 30
5 ...
N 56°04'39.16"
E 12°55'05.25"
April 4, 2007 at 1:16 pm
SELECT Col1, Col2, Col3, COALESCE(Col1, 1) * COALESCE(Col2, 1) + COALESCE(Col3, 0) AS Result
FROM Table1
Col1 = objRs("Col1")
Col2 = objRs("Col2")
Col3 = objRs("Col3")
Result = objRs("Result")
N 56°04'39.16"
E 12°55'05.25"
April 4, 2007 at 1:13 pm
That I can agree on!
But it is not uncommon. One of my clients are in the Insurance business. They have some formulas in an application that can export the values...
N 56°04'39.16"
E 12°55'05.25"
April 4, 2007 at 11:04 am
Yes. It is slower. I told so in the previous post.
BUT...
The upside is how easy it is to change the number of columns to investigate.
2? No problems. 11? No problems. Slower? Yes....
N 56°04'39.16"
E 12°55'05.25"
April 4, 2007 at 7:57 am
Am I too late?
This method is about 15% slower, but is easier to read (and extend to more columns, with or without the use of dynamic sql?)
SELECT
...
N 56°04'39.16"
E 12°55'05.25"
April 4, 2007 at 7:09 am
Some useful readings
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=72097
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=73079
N 56°04'39.16"
E 12°55'05.25"
April 4, 2007 at 6:52 am
WHERE CURRENT OF
???
N 56°04'39.16"
E 12°55'05.25"
April 4, 2007 at 6:49 am
Yes, you can make a table-valued functions and use as any other table or view.
Select t1.* FROM Table AS t1
INNER JOIN fnUserFunction(1) AS u ON u.SomeCol = t1.ThirdCol
Note that if you...
N 56°04'39.16"
E 12°55'05.25"
April 4, 2007 at 3:16 am
You can't use dynamic SQL in a function.
http://www.sommarskog.se/dynamic_sql.html
N 56°04'39.16"
E 12°55'05.25"
April 4, 2007 at 3:01 am
1) Why would I? Then you have no control over the datatype for the aggregated column VALUE (sum).
2) The syntax is wrong. It should be SELECT .. INTO...FROM ... WHERE...
N 56°04'39.16"
E 12°55'05.25"
April 3, 2007 at 10:51 pm
SELECT
v.p_id,
v
.c_id,
v
.s_id,
v
.r_id,
v
N 56°04'39.16"
E 12°55'05.25"
April 3, 2007 at 8:41 am
April 3, 2007 at 7:51 am
Viewing 15 posts - 1,711 through 1,725 (of 2,171 total)