nope what i'm trying to do is different there is no join performed, all i'm
trying to do is get x number of records from tblData where x='value' field
in tblSomeInfo. my thought for this was to try:

select top (select value from someInfo where uid=4) *
from tblData

but the top function wont allow a query based 'top' value. in SS7 help
files, they tell you to do the 'set recordcount' command, so something like:

declare @myvar int
select @myvar=value from someInfo where uid=4
select top @myvar *
from tblData

or 

declare @myvar int
select @myvar=value from someInfo where uid=4
set recordcount @myvar
select *
from tblData

but this for some reason only returns a true or false for execution... 
any ideas on how i can do this in a query



At 05:33 PM 3/28/00 -0800, you wrote:
>Ii'm not 100% sure of what it is you are trying to do.  Are you looking to
>pull all the information in 'tblData' that corresponds to the uid in
>tblSomeInfo???? If so, you do this.
>
>SELECT d.*
>  FROM tblSomeInfo s, tblData d
> WHERE s.uid = [whichever uid you are looking for] AND s.uid = d.uid
>
>That will return all the information in tblData that coresponds to the
>Information in tblSomeInfo.  However, it is an unnecessary process.  If you
>already know the uid of what you are looking for, just do a select statement
>on tblData.  Perhaps You can tell me what information it is you are starting
>with, and then what info you want from the table structure as a result of
>your Query.
>
>-J
>
>-----Original Message-----
>From: Chris Porter [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, March 28, 2000 4:31 PM
>To: [EMAIL PROTECTED]
>Subject: SQL question
>
>
>hey guys, here's what i'm trying to do.. maybe some of you sql guru's out
>there can help. basically, i've got a field in a record that states the
>number of records in another table that i want to view & i need a sql query
>to gather those rows.
>
>heres the schema
>
>tblSomeInfo                            tblData
>
>| uid   |   value  |           |- uid  -|-- value -|
>--------|----------|           |---3----|---out----|
>---1----|-----5----|           |---1----|---test---|
>---2----|-----3----|           |---2----|--- me ---|
>---3----|-----7----|           |---3----|---out----|
>                               |---4----|--- i ----|
>                               |---5----|--need----|
>                               |---6----|---help---|
>
>
>the idea is that after this query, depending on which uid in some info,
>only the number of records stored in value will be returned. for instance,
>assuming it's uid=1, only 5 records would be returned from tblData. or if
>uid=2, only 3 records would be returned.
>
>any ideas on how this can be done?
>thnx
>-chris
>
>
>
>----------------------------------------------------------------------------
>--
>Archives: http://www.eGroups.com/list/cf-talk
>To Unsubscribe visit
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
>send a message to [EMAIL PROTECTED] with 'unsubscribe' in
>the body.
>
>
>---------------------------------------------------------------------------
---
>Archives: http://www.eGroups.com/list/cf-talk
>To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to