473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

General question about specific SQL problem

Hello,

I can usually find answers to my own question on the web but in this case I don't know where to look.

Asume I have a simple table 'Fruit' with the fields fruit and cost. Asume it is filled like:

Apple, 0,44
Orange, 0,69
Banana, 0,51

Now I want to put together baskets. Let's make 2 of them with the following content:
'For lunch' with 1 apple and 1 banana
'With extra vitamines' with 1 apple and 2 oranges.

What single query is able to produce the following simple output:

For lunch, 0,95
With extra vitamines, 1,82

The idea is to have this in a View so that I can select from this output for other purposes.

Thanks in advance,

André
Jan 3 '11 #1
1 1075
ck9663
2,878 Expert 2GB
Why not create a table named Basket<sequence> (the sequence should make it unique. Or you can name it LunchBasket. Then just do an inner join with your Fruit Table.

Happy Coding!!!

~~ CK
Jan 3 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: diadia | last post by:
#include <iostream> using namespace std; void main() { char *a; a = new char; cin >> a; cout << a; }
4
by: jwa6 | last post by:
I have a user/pc specific problem in access. This doesn't occur on any other ( windows xp pc) that I have used the ..mbd on. This involves a query that's using a range of dates as a parm. This...
21
by: tyler_durden | last post by:
hi there peeps... like I say in the topic, I need to do an e-mail program in C language, and has to be made until the 3th of january..the problem is I'm having some problems with it. I was...
0
by: Hrvoje Vrbanc | last post by:
Hello, this is a problem I came upon while building a site based on MCMS 2002 but it's not strictly MCMS-oriented: I have a page that displays a certain content in presentation mode but when an...
10
by: storyGerald | last post by:
Recently, I'm interested in writing very efficient code. Problem: there is a sequence { a(0), a(1), ..., a(n-1) } and a very small positive integer k, write an algorithm without using multiply...
0
by: rxgmoral | last post by:
about dll problem,thank:) i have two file a static dll file ,another static Exe file i think Exe call List Class in dll,but.......... ************************static...
3
by: wokm4n | last post by:
Hi, I'm currently working on this: http://www.richardvenneman.nl/kazenokoe The left part of the 'latest releases' is fixed width. A random image appears on the right side. But there seems to...
21
by: softwindow | last post by:
#include "stdio.h" #include "malloc.h" struct student{ int age; char *nms; struct student *next; }; struct student *create(){ int ags=0,size=sizeof(struct student); char *nms=" ";
2
by: dull1234 | last post by:
Hi all I am having a question about Excel VBA Hope that this is the right place to ask Now i am having 2 giant spreadsheets, one has about 2000 entries, another one has about 1000 entries. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.