Monday, March 26, 2012

query

There are two tables
Expense Table
Amount date
5000 01/01/2004
5000 01/01/2004
100 01/01/2004
Sal Table
Amount date
10000 01/01/2004
400 01/01/2004
500 01/01/2004
100 01/01/2004
expense amount sale amount
5000 10000
5000 400
100 500
100
I want the data like this against 01/01/2004 date, can any body give me
query that how I fulfill that one.
Thanks
NOOR
You would be best laying it out in this format client side. Just write
two stored procedures, one to retrieve the expenses and one to retrieve
the sales, both that take a data as a parameter and then process them
client side.
Regards,
William D. Bartholomew
http://blog.bartholomew.id.au/
*** Sent via Developersdex http://www.codecomments.com ***
Don't just participate in USENET...get rewarded for it!
|||What logic would you use to join these two tables? How do you know, for
instance, that either of the given 5000 expense amounts corresponds to a
given sale (say, the 10000 item you have matched up in your sample output?)
Are there more columns (like, a primary key?)
Please post DDL (full table definitions in SQL), as well as sample data in
the form of INSERT statements.
"Noorali Issani" <naissani@.softhome.net> wrote in message
news:%23FcnRIWPEHA.3748@.TK2MSFTNGP09.phx.gbl...
> There are two tables
> Expense Table
> Amount date
> 5000 01/01/2004
> 5000 01/01/2004
> 100 01/01/2004
> Sal Table
> Amount date
> 10000 01/01/2004
> 400 01/01/2004
> 500 01/01/2004
> 100 01/01/2004
>
> expense amount sale amount
> 5000 10000
> 5000 400
> 100 500
> 100
> I want the data like this against 01/01/2004 date, can any body give me
> query that how I fulfill that one.
> Thanks
> NOOR
>

No comments:

Post a Comment