Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 28-03-2007, 08:19 PM   #1 (permalink)
Just another linux lover.
 
subratabera's Avatar
 
Join Date: Jun 2006
Location: Bangalore, KA
Posts: 562
Question Need Help:SQL Query...


Hello all SQL experts...

Here is a problem for you. I hope and very much expect that you can solve it easily...

Here is the data...(Items are sold at diff. times. Thats why they are separated.)

Quote:
Date --- ID --- ShopNo --- Item --- Qty Sold
23-Jan-07 --- SH --- SH1 --- Apple --- 348
23-Jan-07 --- SH --- SH1 --- Apple --- 386
23-Jan-07 --- SH --- SH1 --- Apple --- 370
23-Jan-07 --- SH --- SH1 --- Grape --- 720
23-Jan-07 --- SH --- SH1 --- Grape --- 56
23-Jan-07 --- SH --- SH1 --- Grape --- 268
23-Jan-07 --- ML --- ML1 --- Apple --- 846
23-Jan-07 --- ML --- ML1 --- Apple --- 762
23-Jan-07 --- ML --- ML1 --- Apple --- 576
23-Jan-07 --- ML --- ML1 --- Grape --- 22
23-Jan-07 --- ML --- ML1 --- Grape --- 333
23-Jan-07 --- ML --- ML1 --- Grape --- 997
24-Jan-07 --- SH --- SH1 --- Apple --- 721
24-Jan-07 --- SH --- SH1 --- Apple --- 978
24-Jan-07 --- SH --- SH1 --- Apple --- 773
24-Jan-07 --- SH --- SH1 --- Grape --- 565
24-Jan-07 --- SH --- SH1 --- Grape --- 350
24-Jan-07 --- SH --- SH1 --- Grape --- 175
24-Jan-07 --- ML --- ML1 --- Apple --- 795
24-Jan-07 --- ML --- ML1 --- Apple --- 804
24-Jan-07 --- ML --- ML1 --- Apple --- 132
24-Jan-07 --- ML --- ML1 --- Grape --- 188
24-Jan-07 --- ML --- ML1 --- Grape --- 234
24-Jan-07 --- ML --- ML1 --- Grape --- 873
25-Jan-07 --- SH --- SH1 --- Apple --- 802
25-Jan-07 --- SH --- SH1 --- Apple --- 747
25-Jan-07 --- SH --- SH1 --- Apple --- 468
25-Jan-07 --- SH --- SH1 --- Grape --- 229
25-Jan-07 --- SH --- SH1 --- Grape --- 758
25-Jan-07 --- SH --- SH1 --- Grape --- 798
25-Jan-07 --- ML --- ML1 --- Apple --- 611
25-Jan-07 --- ML --- ML1 --- Apple --- 785
25-Jan-07 --- ML --- ML1 --- Apple --- 450
25-Jan-07 --- ML --- ML1 --- Grape --- 317
25-Jan-07 --- ML --- ML1 --- Grape --- 596
25-Jan-07 --- ML --- ML1 --- Grape --- 961
I want the output as follows...(Date wise total sold qty)

Quote:
Date --- ID --- ShopNo --- Item --- TotalQtySold
23-Jan-07 --- SH --- SH1 --- Apple --- 1104
23-Jan-07 --- SH --- SH1 --- Grape --- 1044
23-Jan-07 --- ML --- ML1 --- Apple --- 2184
23-Jan-07 --- ML --- ML1 --- Grape --- 1352
24-Jan-07 --- SH --- SH1 --- Apple --- 2472
24-Jan-07 --- SH --- SH1 --- Grape --- 1090
24-Jan-07 --- ML --- ML1 --- Apple --- 1731
24-Jan-07 --- ML --- ML1 --- Grape --- 1295
----------
----------
----------
I am also attaching an MSACCESS document which contains the above table. It will be very much helpful if you use its query feature to solve the problem.

Thanks in advance...

Subrata Bera.

P.S. -There will be no primary key in the table.
Attached Files
File Type: zip SQLProblem.zip (10.6 KB, 3 views)
__________________
Today is a most unusual day, because we have never lived it before; we will never live it again; it is the only day we have.
(Registered Linux User #432737 - subratabera.blogspot.com)

Last edited by subratabera; 28-03-2007 at 08:44 PM.
subratabera is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 29-03-2007, 02:18 AM   #2 (permalink)
Back to School Mr. Bean !
 
mod-the-pc's Avatar
 
Join Date: Apr 2004
Location: Chennai
Posts: 343
Default Re: Need Help:SQL Query...

Here's the query
Attached Files
File Type: zip SQLProblem.zip (12.2 KB, 6 views)
__________________
Desktop: P4 2.8E, Intel 865GBF, 512MB Hynix PC3200, Samsung SV1204H 120GB, Samsung SW-248F, Creative Inspire 4400, Samsung 793MB, Compro PVR/FM, WinLIRC

Laptop: HP Pavilion dv8210us
mod-the-pc is offline  
Old 29-03-2007, 11:28 AM   #3 (permalink)
Just another linux lover.
 
subratabera's Avatar
 
Join Date: Jun 2006
Location: Bangalore, KA
Posts: 562
Default Re: Need Help:SQL Query...

Thankyou very much @mod-the-pc. You are really great. You have solved a big problem for me. I am searching for this answer for quite a long time...

Thankyou once again.

Subrata Bera
__________________
Today is a most unusual day, because we have never lived it before; we will never live it again; it is the only day we have.
(Registered Linux User #432737 - subratabera.blogspot.com)
subratabera is offline  
Old 29-03-2007, 12:02 PM   #4 (permalink)
Beware of the innocent
 
ilugd's Avatar
 
Join Date: Dec 2005
Posts: 1,024
Default Re: Need Help:SQL Query...

I don't have access on my sys, but just out of curiosity sake, I guess it would have been a group by with sum. Am I right mod-the-pc?
__________________
Life is too short. Have fun.
ilugd is offline  
Old 29-03-2007, 12:04 PM   #5 (permalink)
CG Artist
 
gaurav_indian's Avatar
 
Join Date: May 2006
Location: New Delhi,India
Posts: 1,462
Default Re: Need Help:SQL Query...

Yes.Group by clause will be used for this query.
gaurav_indian is offline  
Old 29-03-2007, 05:18 PM   #6 (permalink)
Back to School Mr. Bean !
 
mod-the-pc's Avatar
 
Join Date: Apr 2004
Location: Chennai
Posts: 343
Default Re: Need Help:SQL Query...

Quote:
Originally Posted by ilugd
I don't have access on my sys, but just out of curiosity sake, I guess it would have been a group by with sum. Am I right mod-the-pc?
Yes, Perfect!
__________________
Desktop: P4 2.8E, Intel 865GBF, 512MB Hynix PC3200, Samsung SV1204H 120GB, Samsung SW-248F, Creative Inspire 4400, Samsung 793MB, Compro PVR/FM, WinLIRC

Laptop: HP Pavilion dv8210us
mod-the-pc is offline  
Old 29-03-2007, 10:33 PM   #7 (permalink)
Just another linux lover.
 
subratabera's Avatar
 
Join Date: Jun 2006
Location: Bangalore, KA
Posts: 562
Default Re: Need Help:SQL Query...

Actually I am working on a database project (for my own use) which needs such query...I am trying to solve that problem for quite a long time but I am very weak in Access and SQL. But thanks to this forum and @mod-the-pc I got my answer...
__________________
Today is a most unusual day, because we have never lived it before; we will never live it again; it is the only day we have.
(Registered Linux User #432737 - subratabera.blogspot.com)
subratabera is offline  
Old 30-03-2007, 01:26 PM   #8 (permalink)
Beware of the innocent
 
ilugd's Avatar
 
Join Date: Dec 2005
Posts: 1,024
Default Re: Need Help:SQL Query...

whats so difficult about access. Whatever language you are using for the project would be much more tougher. I would say sql is much easier. Have you tried reading a book on sql that explains the concepts?
__________________
Life is too short. Have fun.
ilugd is offline  
Old 31-03-2007, 09:54 AM   #9 (permalink)
Just another linux lover.
 
subratabera's Avatar
 
Join Date: Jun 2006
Location: Bangalore, KA
Posts: 562
Default Re: Need Help:SQL Query...

Actually I am designing the project entirely in ACCESS. This is a simple database project which gives me various results and prepare reports based on various queries. That's it...

BTW I am reading some books on ACCESS and SQL and hopefully learn them(as per my requirements) soon...
__________________
Today is a most unusual day, because we have never lived it before; we will never live it again; it is the only day we have.
(Registered Linux User #432737 - subratabera.blogspot.com)
subratabera is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query 4 Hub. LEARNER_LEARNER Hardware Q&A 1 08-12-2006 01:49 AM
SMS query hack expert Mobiles and Tablets 2 15-02-2006 11:20 PM
gta sa query nishant_garg89 Gamerz 5 05-02-2006 09:29 PM
30 fps query Tommygecko Gamerz 1 22-05-2005 01:07 AM
Microtek Monitor Query and PHPBB Attachment Mod Query vwad Software Q&A 1 20-03-2005 09:32 AM

 
Latest Threads
- by Sujeet
- by Krow
- by abhidev
- by topgear

Advertisement




All times are GMT +5.5. The time now is 07:52 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2