Re: SQL Statement

From: Michael Austin <maustin_at_firstdbasource.com>
Date: Tue, 24 Feb 2009 19:45:12 -0600
Message-ID: <uh1pl.13576$D32.5039_at_flpi146.ffdc.sbc.com>



ddf wrote:
> On Feb 24, 3:28 pm, mrdjmag..._at_aol.com wrote:
>> On Feb 24, 3:20 pm, ddf <orat..._at_msn.com> wrote:
>>
>>
>>
>>
>>
>>> On Feb 24, 3:10 pm, mrdjmag..._at_aol.com wrote:
>>>> Hello,
>>>> Can you have a select statement that returns a literal AND normal
>>>> query results without a UNION?
>>>> Say I have a parameter, like and employee ID, passed to a procedure.
>>>> I want to run a query which returns the top 4 records in the result
>>>> set PLUS the values from the employee ID passed in.......So, 5 records
>>>> total.
>>>> The query is long, so I'm hoping to do it without a UNION.......
>>>> Much Thanks
>>> Provide an example of the output you want to see, as well as the table
>>> definition and some sample data.
>>> David Fitzjarrell
>> The other way, is to possibly run a query that would return only the 4
>> employee ID's, excluding the one passed in, and then create the
>> dynamic query string using an IN clause, with the 4 from the previous
>> query plus the one passed in.....
>>
>> That would work.- Hide quoted text -
>>
>> - Show quoted text -

>
> You've provided a minimal example and no table definitions nor sample
> data with which to work, and you expect a query to be magically
> written to solve your issue. A basic stab will involve UNION unless
> you will provide table DDL and data, so, seriously, if you want
> assistance with this provide us the tools requested to begin the
> task.
>
>
> David Fitzjarrell

with something this generic and this simple - sounds like homework to me. He doesn't even appear to know how spell the correct verb for retrieving even the basics.

To the OP - Show us what you have tried and why you think it isn't working. Received on Tue Feb 24 2009 - 19:45:12 CST

Original text of this message