Hi Rudy,
Yes, it's quite the query but performs extremely fast so my indexes must be working well ! :) The sales table has millions and millions of records and the query is generated dynamically with lots of parameters...
I'm not really sure I can get rid of the 2nd temporary table. I cannot...
It makes so much sense now that I'm looking at your sql code...I don't know why that didn't come to me. Thank you so much for your help...now I'm off to implement :)
Hi r937, you've helped me a great deal in the past, good to see you're still around helping out!
My columns are
his_key (group/department)
key_desc
his_loctn (location)
ty_retail
ty_cost
ty_units
ly_retail
ly_cost
ly_units
My ORDER BY clause is
ORDER BY his_key, his_loctn
Some SQL would...
I have a query that totals up sales at retail and cost by Group/Location. Up to this point I have been just ordering my results by group name (alphabetically) and by location. I need to now sort by results by the Group with the most sales.
So if my results before were like the following,
CHILD...
Thanks for you feedback. At least I know I'm on the right track with the join structure.
I believe the reason I'm getting more records than I should is due to what you mentioned, the one-to-many relationships. Table A has a one-to-many relationship with tables B and C. I'll do some more...
I need to make a join between 3 tables, where the 3rd table is dependent on the join of the first two. Here's an example to elaborate,
Table A
A.col1
A.col2
...
A.colN
Table B
B.col1
B.col2
B.col3
...
B.colN
Table C
C.col1
C.col2
C.col3
...
C.colN
I need col1 from table A, col2 from table B...
Here's what I've come up with so far, and I just noticed it's very similar to Riverguy's response,
SELECT MenuItem.*
, sales.*
FROM MenuItem
JOIN (
SELECT DISTINCT custitem.PLU
, custitem.LocationNo
, MAX(Custinv.InvoiceDate) AS LastSold
FROM Custinv JOIN custitem
ON...
I need to write a query selects all items from an inventory table 'MenuItem' that have sold since a user specified date. The sales table 'Custinv' has a record for every item sold by date and location (quite a large amount of records).
I'm not really sure how to proceed, should I be joining...
Just a quick update on my laptop. The technician replaced the motherboard this morning and that corrected the problem. Looks like it was hardware after all.
Hi Phil, thanks for your response.
My laptop has a FN+F5 to enable dual display. This just mimics the Win+P button function. I have also tried enabling it from nvidia control panel as well as through the windows control panel.
I have also tried completely removing and reinstall the nvidia...
Whenever I try to enable a secondary display on my laptop it detects the monitor but then all it does is flash the desktop and then go black, like it's stuck in this auto-detect loop or something. I have tried multiple monitors and get the same thing. What's even funnier is that it worked the...
Thanks Dan for your reply but I have since solved my problem. Not sure exactly what caused it but I dumped the tomcat6 install that came with ubuntu server and did a manual install of tomcat 6.0.20 from apache.org. I also had to modify the my.cnf file to bind to 127.0.0.1. I had a bunch of...
I am running ubuntu server 9.10 with Tomcat 6, using java-sun-jdk.
Tomcat is running but throws an error when I'm trying to start the openreports webapp, here's the error:
SEVERE: Exception sending context initialized event to listener instance of class...
...am still not getting the correct results. Here's my query,
SELECT trim(substr(pm_element,4,3)) AS department
, pm_str_var as dept_desc
, sales.*
FROM syparamt
LEFT JOIN (
SELECT syinvhdr.ih_dept
, syinvhdr.ih_style
, syinvdtl.id_loctn
, SUM(syinvhis.his_salretl) as retail
...
I'm having some problems coming up with a "Top N Of Group" query. I've googled it as well as gone through this forum but cannot come up with anything that works. Here's my situation, hopefully someone might have some tips to point me in the right direction.
I have 3 tables needed in the query...
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.