If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > How to write a function to populate a table..

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-22-11, 22:56
sybasenewbie sybasenewbie is offline
Registered User
 
Join Date: Jun 2011
Posts: 1
Question How to write a function to populate a table..

Hello all, I am a newbie to Sybase and This is an emergency requirement of my client..

I need to write a function to populate a temporary table.


My Query is this way:


select p.product,max(p.price)as price
into #temptable
from owner.products p,
(select product,max(date) from owner.products where product = 'mouse' group by product) q
where p.product = q.product and
p.date = q.date
group by p.product


This is my query..where in I am populating the data into a table named "temptable"

I need to implement this little query by using a function..
I would be passing a parameter for 'mouse' through the function as Input..
Please help me..
Reply With Quote
Reply

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On