php is a pretty powerful language
write an IF test in php so that if no date range is specified, then remove those lines from the sql statement
easy peasy
r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
all those datatypes are okay except LONGTEXT which should be TEXT
however, you must also remove the "length" from the numeric datatypes
int(11) --> int
tinyint(1) --> tinyint
tinyint(4) --> tinyint
etc.
r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
SELECT AVG(t.result) AS avg_result
FROM ( SELECT id
, MAX(time_of_execution) AS max_time
FROM results_tbl
GROUP
BY id ) AS m
INNER
JOIN results_tbl AS t
ON t.id = m.id
AND t.time_of_execution = t.max_time
r937.com | rudy.ca
Buy my new...
SELECT t.id
, t.time_of_execution
, t.result
FROM ( SELECT id
, MAX(time_of_execution) AS max_time
FROM results_tbl
GROUP
BY id ) AS m
INNER
JOIN results_tbl AS t
ON t.id = m.id
AND t.time_of_execution = t.max_time
r937.com |...
not easily
best you can do is code up one SELECT for each custom table, and then UNION ALL all the results together
SELECT * FROM customa
UNION ALL
SELECT * FROM customb
UNION ALL
SELECT * FROM customc
...
the better solution, based on what i see in customa and customb, is to combine all...
wish i knew
however, <cfif Evaluate(varA) IS Evaluate(varB)>true<cfelse>false</cfif>
produces false
r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
looks like you posted an oracle question in the microsoft sql server forum
but anyhow...
SELECT TO_CHAR(TO_DATE('dec 7,2012', 'mon dd, yyyy'), 'Mon, yyyy') as Month
, TO_DATE('dec 7,2012', 'mm dd,yyyy') -
LAST_DAY(TO_DATE('nov 7,2012', 'mm dd,yyyy') )as Days
FROM dual
UNION ALL...
i have no idea, because i don't do oracle
but i would guess Oracle release 11g or whatever one corresponds to the version you're using
r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
any chance i could get you to apply some formatting to your queries? it's awfully hard to read and understand them all strung out like that
SELECT collector
, portfolio_name AS portfolio
, sum(numAccts) AS "number of accounts"
, sum(numPendPayments)
, sum(totalPending)...
with the associated data" is the clue here
you can remove columns from the GROUP BY as long as in the SELECT clause you put them inside aggregate functions
so...
SELECT collector
, portfolio_name AS portfolio
, SUM(numAccts) AS "number of accounts"
, SUM(numPendPayments)
...
not to be pedantic or anything, but the next time you have an oracle problem, could you please post it in one of the oracle forums?
this forum is for microsoft sql server
r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.