10 TIPs - To Become a Good Developer/Programmer
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Asp.Net Hein
1.9k
266
137.2k
Primary key and foreign key
Sep 21 2015 1:00 AM
I create two tables.
One is StockAmount (Name{primary key}, Amount) and the another one is StockPrice(ID{Primary key with autogenerated}, Name{foreign key with StockAmount table}, Price)
And then I store some data to
StockAmount.
-a 100
-b 200
-c 300
StockPrice
-1 a 20000
-2 b 15000
-3 c 25000
And then I retrieve the data like this.
Select StockAmount.Name,StockAmount.Quantity,StockPrice.Price from StockAmount,StockPrice where StockAmount.Name='a'
The result comes out
a 100 20000
b 200 20000
c 300 20000
I want only one line like
a 100 20000.
Please solve my problem and reply to me. Thanks a lot for your help.
Reply
Answers (
1
)
Merge multiple rows into single row
i need one stored procedure for getting XML Format