select in the select statement

Hi,

I am trying to add another select statement in my
original/outer/overall select statement.  Something like:

Select 1, 2, 3 = (Select # from Table1 Where....) From Table 2
Where....

Does anyone know the standard way to write this or is there any other
alternative that can perform the same behavior.

Much thanks!!

Kenny
0
trank
11/16/2000 10:03:04 PM
sybase.powerbuilder.database 9855 articles. 2 followers. Follow

6 Replies
972 Views

Similar Articles

[PageSpeed] 29

That's database dependent.  In oracle you would use:

select A.* from ( select * from mytable) A
--
Terry Dykstra (TeamSybase)
Please state PB / OS / DB versions in your post.
MySybase http://my.sybase.com/mysybase


"Kenny Tran" <trank@get-integrated.com> wrote in message
news:3a14584a.19809158@forums.sybase.com...
> Hi,
>
> I am trying to add another select statement in my
> original/outer/overall select statement.  Something like:
>
> Select 1, 2, 3 = (Select # from Table1 Where....) From Table 2
> Where....
>
> Does anyone know the standard way to write this or is there any other
> alternative that can perform the same behavior.
>
> Much thanks!!
>
> Kenny


0
Terry
11/16/2000 10:26:04 PM
Thanks for your reply Terry.

If you don't mind, please take a book of my SQL statement down below:

SELECT DISTINCT 
         "RPT_PEC"."RPT_PEC_FUND_EXP",
         "RPT_REIMB"."RPT_REIMB_TYPE",  
         "RPT_BA"."RPT_BA_NUM", 
         (SELECT SUM("RPT_REIMB"."RPT_REIMB_AMNT") FROM "RPT_REIMB",
"RPT_PEC", "RPT_BA"
		 WHERE ( "RPT_REIMB"."RPT_BA_FY" =
"RPT_PEC"."RPT_BA_FY" ) and  
         		  ( "RPT_REIMB"."RPT_MONTH" =
"RPT_PEC"."RPT_MONTH" ) and  
		  ( "RPT_REIMB"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ"
) and  						
		  ( "RPT_REIMB"."RPT_PEC_SEQ" =
"RPT_PEC"."RPT_PEC_SEQ" ) and
		  ( "RPT_REIMB"."RPT_REIMB_TYPE" = 'FORECAST' ) and

		  ( "RPT_BA"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and

		  ( "RPT_BA"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and

		  ( "RPT_BA"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" )
and 
		  ( "RPT_REIMB"."RPT_BA_SEQ" = 653 ) and 
		  ( "RPT_REIMB"."RPT_PEC_SEQ" = 698 ) and 
		  ( "RPT_REIMB"."RPT_BA_FY" = 2001 ) AND  
		  ( "RPT_REIMB"."RPT_MONTH" = 'JAN' ) ) AS AMNT  
    FROM "RPT_MASTER",   
         "RPT_PEC",   
         "RPT_PEC_OBAN",   
         "RPT_REIMB",   
         "RPT_BA"  
   WHERE ( "RPT_PEC_OBAN"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and  
         ( "RPT_PEC_OBAN"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and  
         ( "RPT_PEC_OBAN"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" ) and

         ( "RPT_PEC_OBAN"."RPT_PEC_SEQ" = "RPT_PEC"."RPT_PEC_SEQ" )and

         ( "RPT_MASTER"."RPT_BA_FY" = "RPT_PEC_OBAN"."RPT_BA_FY" ) and

         ( "RPT_MASTER"."RPT_MONTH" = "RPT_PEC_OBAN"."RPT_MONTH" ) and

         ( "RPT_BA"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and  
         ( "RPT_BA"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and 
	 ( "RPT_BA"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" ) and 
         ( "RPT_REIMB"."RPT_REIMB_TYPE" = 'FORECAST' ) AND  
         ( ( "RPT_PEC_OBAN"."RPT_BA_FY" = :fy ) AND  
         ( "RPT_PEC_OBAN"."RPT_MONTH" = :month ) )

(Note: I simplified the select statement a little bit to ease the
eyes=))
Terry, when I try to execute this statement in my DW, I got the error
"ORA-00936: missing expression".  I know this has to do with my select
statement in my select list.  However, I have no idea how to fix this
problem.  Do you see anything that I don't?

PB7/WIN95/ORACLE 7.3.0.

Thanks!

Kenny
0
trank
11/16/2000 11:53:16 PM
Terry,

It's PB6.  Thanks...
0
trank
11/16/2000 11:54:19 PM
(PMFJI )Oracle doesn't let you have a nested select in the Select clause,
but what you can do, as in Terry's example, is put it in the From clause,
give it an alias, and then refer to its columns in the Select clause, e.g.:

select employee.last_name,
        salary.total_salary
from employee,
        (select sum(salary) as total_salary
         from employee_salaries
        where employee_salaries.emp_id = employee.emp_id ) as salary;


Ken Balakrishnan

"Kenny Tran" <trank@get-integrated.com> wrote in message
news:3a14715b.26227016@forums.sybase.com...
> Thanks for your reply Terry.
>
> If you don't mind, please take a book of my SQL statement down below:
>
> SELECT DISTINCT
>          "RPT_PEC"."RPT_PEC_FUND_EXP",
>          "RPT_REIMB"."RPT_REIMB_TYPE",
>          "RPT_BA"."RPT_BA_NUM",
>          (SELECT SUM("RPT_REIMB"."RPT_REIMB_AMNT") FROM "RPT_REIMB",
> "RPT_PEC", "RPT_BA"
> WHERE ( "RPT_REIMB"."RPT_BA_FY" =
> "RPT_PEC"."RPT_BA_FY" ) and
>            ( "RPT_REIMB"."RPT_MONTH" =
> "RPT_PEC"."RPT_MONTH" ) and
>   ( "RPT_REIMB"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ"
> ) and
>   ( "RPT_REIMB"."RPT_PEC_SEQ" =
> "RPT_PEC"."RPT_PEC_SEQ" ) and
>   ( "RPT_REIMB"."RPT_REIMB_TYPE" = 'FORECAST' ) and
>
>   ( "RPT_BA"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and
>
>   ( "RPT_BA"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and
>
>   ( "RPT_BA"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" )
> and
>   ( "RPT_REIMB"."RPT_BA_SEQ" = 653 ) and
>   ( "RPT_REIMB"."RPT_PEC_SEQ" = 698 ) and
>   ( "RPT_REIMB"."RPT_BA_FY" = 2001 ) AND
>   ( "RPT_REIMB"."RPT_MONTH" = 'JAN' ) ) AS AMNT
>     FROM "RPT_MASTER",
>          "RPT_PEC",
>          "RPT_PEC_OBAN",
>          "RPT_REIMB",
>          "RPT_BA"
>    WHERE ( "RPT_PEC_OBAN"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and
>          ( "RPT_PEC_OBAN"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and
>          ( "RPT_PEC_OBAN"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" ) and
>
>          ( "RPT_PEC_OBAN"."RPT_PEC_SEQ" = "RPT_PEC"."RPT_PEC_SEQ" )and
>
>          ( "RPT_MASTER"."RPT_BA_FY" = "RPT_PEC_OBAN"."RPT_BA_FY" ) and
>
>          ( "RPT_MASTER"."RPT_MONTH" = "RPT_PEC_OBAN"."RPT_MONTH" ) and
>
>          ( "RPT_BA"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and
>          ( "RPT_BA"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and
> ( "RPT_BA"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" ) and
>          ( "RPT_REIMB"."RPT_REIMB_TYPE" = 'FORECAST' ) AND
>          ( ( "RPT_PEC_OBAN"."RPT_BA_FY" = :fy ) AND
>          ( "RPT_PEC_OBAN"."RPT_MONTH" = :month ) )
>
> (Note: I simplified the select statement a little bit to ease the
> eyes=))
> Terry, when I try to execute this statement in my DW, I got the error
> "ORA-00936: missing expression".  I know this has to do with my select
> statement in my select list.  However, I have no idea how to fix this
> problem.  Do you see anything that I don't?
>
> PB7/WIN95/ORACLE 7.3.0.
>
> Thanks!
>
> Kenny


0
Ken
11/17/2000 3:22:59 PM
Hi Ken,

I appreciate very much for your reply.  You know when I tried to
execute a similar statement that is in your given format, I got an
error.  The error says: "ORA-00933: SQL command not properly ended."

Do you have any idea why?

Thanks a lot!!

On Fri, 17 Nov 2000 10:22:59 -0500, "Ken Balakrishnan"
<kbalakri@med***mktg.com> wrote:

>(PMFJI )Oracle doesn't let you have a nested select in the Select clause,
>but what you can do, as in Terry's example, is put it in the From clause,
>give it an alias, and then refer to its columns in the Select clause, e.g.:
>
>select employee.last_name,
>        salary.total_salary
>from employee,
>        (select sum(salary) as total_salary
>         from employee_salaries
>        where employee_salaries.emp_id = employee.emp_id ) as salary;
>
>
>Ken Balakrishnan
>
>"Kenny Tran" <trank@get-integrated.com> wrote in message
>news:3a14715b.26227016@forums.sybase.com...
>> Thanks for your reply Terry.
>>
>> If you don't mind, please take a book of my SQL statement down below:
>>
>> SELECT DISTINCT
>>          "RPT_PEC"."RPT_PEC_FUND_EXP",
>>          "RPT_REIMB"."RPT_REIMB_TYPE",
>>          "RPT_BA"."RPT_BA_NUM",
>>          (SELECT SUM("RPT_REIMB"."RPT_REIMB_AMNT") FROM "RPT_REIMB",
>> "RPT_PEC", "RPT_BA"
>> WHERE ( "RPT_REIMB"."RPT_BA_FY" =
>> "RPT_PEC"."RPT_BA_FY" ) and
>>            ( "RPT_REIMB"."RPT_MONTH" =
>> "RPT_PEC"."RPT_MONTH" ) and
>>   ( "RPT_REIMB"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ"
>> ) and
>>   ( "RPT_REIMB"."RPT_PEC_SEQ" =
>> "RPT_PEC"."RPT_PEC_SEQ" ) and
>>   ( "RPT_REIMB"."RPT_REIMB_TYPE" = 'FORECAST' ) and
>>
>>   ( "RPT_BA"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and
>>
>>   ( "RPT_BA"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and
>>
>>   ( "RPT_BA"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" )
>> and
>>   ( "RPT_REIMB"."RPT_BA_SEQ" = 653 ) and
>>   ( "RPT_REIMB"."RPT_PEC_SEQ" = 698 ) and
>>   ( "RPT_REIMB"."RPT_BA_FY" = 2001 ) AND
>>   ( "RPT_REIMB"."RPT_MONTH" = 'JAN' ) ) AS AMNT
>>     FROM "RPT_MASTER",
>>          "RPT_PEC",
>>          "RPT_PEC_OBAN",
>>          "RPT_REIMB",
>>          "RPT_BA"
>>    WHERE ( "RPT_PEC_OBAN"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and
>>          ( "RPT_PEC_OBAN"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and
>>          ( "RPT_PEC_OBAN"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" ) and
>>
>>          ( "RPT_PEC_OBAN"."RPT_PEC_SEQ" = "RPT_PEC"."RPT_PEC_SEQ" )and
>>
>>          ( "RPT_MASTER"."RPT_BA_FY" = "RPT_PEC_OBAN"."RPT_BA_FY" ) and
>>
>>          ( "RPT_MASTER"."RPT_MONTH" = "RPT_PEC_OBAN"."RPT_MONTH" ) and
>>
>>          ( "RPT_BA"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and
>>          ( "RPT_BA"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and
>> ( "RPT_BA"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" ) and
>>          ( "RPT_REIMB"."RPT_REIMB_TYPE" = 'FORECAST' ) AND
>>          ( ( "RPT_PEC_OBAN"."RPT_BA_FY" = :fy ) AND
>>          ( "RPT_PEC_OBAN"."RPT_MONTH" = :month ) )
>>
>> (Note: I simplified the select statement a little bit to ease the
>> eyes=))
>> Terry, when I try to execute this statement in my DW, I got the error
>> "ORA-00936: missing expression".  I know this has to do with my select
>> statement in my select list.  However, I have no idea how to fix this
>> problem.  Do you see anything that I don't?
>>
>> PB7/WIN95/ORACLE 7.3.0.
>>
>> Thanks!
>>
>> Kenny
>

0
trank
11/17/2000 6:19:24 PM
Oops, my fault -- take out the "as" in the From clause and it should work.

Ken Balakrishnan

"Kenny Tran" <trank@get-integrated.com> wrote in message
news:3a157612.8191407@forums.sybase.com...
> Hi Ken,
>
> I appreciate very much for your reply.  You know when I tried to
> execute a similar statement that is in your given format, I got an
> error.  The error says: "ORA-00933: SQL command not properly ended."
>
> Do you have any idea why?
>
> Thanks a lot!!
>
> On Fri, 17 Nov 2000 10:22:59 -0500, "Ken Balakrishnan"
> <kbalakri@med***mktg.com> wrote:
>
> >(PMFJI )Oracle doesn't let you have a nested select in the Select clause,
> >but what you can do, as in Terry's example, is put it in the From clause,
> >give it an alias, and then refer to its columns in the Select clause,
e.g.:
> >
> >select employee.last_name,
> >        salary.total_salary
> >from employee,
> >        (select sum(salary) as total_salary
> >         from employee_salaries
> >        where employee_salaries.emp_id = employee.emp_id ) as salary;
> >
> >
> >Ken Balakrishnan
> >
> >"Kenny Tran" <trank@get-integrated.com> wrote in message
> >news:3a14715b.26227016@forums.sybase.com...
> >> Thanks for your reply Terry.
> >>
> >> If you don't mind, please take a book of my SQL statement down below:
> >>
> >> SELECT DISTINCT
> >>          "RPT_PEC"."RPT_PEC_FUND_EXP",
> >>          "RPT_REIMB"."RPT_REIMB_TYPE",
> >>          "RPT_BA"."RPT_BA_NUM",
> >>          (SELECT SUM("RPT_REIMB"."RPT_REIMB_AMNT") FROM "RPT_REIMB",
> >> "RPT_PEC", "RPT_BA"
> >> WHERE ( "RPT_REIMB"."RPT_BA_FY" =
> >> "RPT_PEC"."RPT_BA_FY" ) and
> >>            ( "RPT_REIMB"."RPT_MONTH" =
> >> "RPT_PEC"."RPT_MONTH" ) and
> >>   ( "RPT_REIMB"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ"
> >> ) and
> >>   ( "RPT_REIMB"."RPT_PEC_SEQ" =
> >> "RPT_PEC"."RPT_PEC_SEQ" ) and
> >>   ( "RPT_REIMB"."RPT_REIMB_TYPE" = 'FORECAST' ) and
> >>
> >>   ( "RPT_BA"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and
> >>
> >>   ( "RPT_BA"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and
> >>
> >>   ( "RPT_BA"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" )
> >> and
> >>   ( "RPT_REIMB"."RPT_BA_SEQ" = 653 ) and
> >>   ( "RPT_REIMB"."RPT_PEC_SEQ" = 698 ) and
> >>   ( "RPT_REIMB"."RPT_BA_FY" = 2001 ) AND
> >>   ( "RPT_REIMB"."RPT_MONTH" = 'JAN' ) ) AS AMNT
> >>     FROM "RPT_MASTER",
> >>          "RPT_PEC",
> >>          "RPT_PEC_OBAN",
> >>          "RPT_REIMB",
> >>          "RPT_BA"
> >>    WHERE ( "RPT_PEC_OBAN"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and
> >>          ( "RPT_PEC_OBAN"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and
> >>          ( "RPT_PEC_OBAN"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" ) and
> >>
> >>          ( "RPT_PEC_OBAN"."RPT_PEC_SEQ" = "RPT_PEC"."RPT_PEC_SEQ" )and
> >>
> >>          ( "RPT_MASTER"."RPT_BA_FY" = "RPT_PEC_OBAN"."RPT_BA_FY" ) and
> >>
> >>          ( "RPT_MASTER"."RPT_MONTH" = "RPT_PEC_OBAN"."RPT_MONTH" ) and
> >>
> >>          ( "RPT_BA"."RPT_BA_FY" = "RPT_PEC"."RPT_BA_FY" ) and
> >>          ( "RPT_BA"."RPT_MONTH" = "RPT_PEC"."RPT_MONTH" ) and
> >> ( "RPT_BA"."RPT_BA_SEQ" = "RPT_PEC"."RPT_BA_SEQ" ) and
> >>          ( "RPT_REIMB"."RPT_REIMB_TYPE" = 'FORECAST' ) AND
> >>          ( ( "RPT_PEC_OBAN"."RPT_BA_FY" = :fy ) AND
> >>          ( "RPT_PEC_OBAN"."RPT_MONTH" = :month ) )
> >>
> >> (Note: I simplified the select statement a little bit to ease the
> >> eyes=))
> >> Terry, when I try to execute this statement in my DW, I got the error
> >> "ORA-00936: missing expression".  I know this has to do with my select
> >> statement in my select list.  However, I have no idea how to fix this
> >> problem.  Do you see anything that I don't?
> >>
> >> PB7/WIN95/ORACLE 7.3.0.
> >>
> >> Thanks!
> >>
> >> Kenny
> >
>


0
Ken
11/17/2000 6:45:05 PM
Reply:

Similar Artilces:

Select Statement, within another Select Statement
Hey All, I have have 2 tables, one is a parrent table called album, the second table is called album content. For each album there will be several album content records I am trying to do a select statement that for each album displayed a single or TOP(1) record only is displayed from the album content table. Now for added complexity not all albums may have album content records, so I have to do an Outer Join to get the album information to show even if there are no album content records. I am using the wizard in VWDE 2008 becuase I am not great at SQL, here is what I have so far, and...

SELECT from SELECT
Hi! I remember seeing an example where you can do a select from a nested select, but I cannot seem to make it work. So it would be something like this: select max( name ) from ( select name from customer union select name from vendor ) Was I dreaming I saw that? Thanks! D In article <4500243f@forums-2-dub>, daniel_AT_infrontsoftware_DOT_com@N0SPAM.com says... > Hi! > > I remember seeing an example where you can do a select from a nested > select, but I cannot seem to make it work. No, you weren't. Try (UNTESTED!) adding a...

Select statement joined on (select..)
 Hi,I have some duplicates CarName and CarType combinations in my table (nevertheless the ID, which is identity) is unique.I tried sorting it out with:SELECT * FROM DimProductsJOIN (select distinct CarType,CarName from DimProducts)But that just gives me> Line 2: Incorrect syntax near ')'.Any ideas?  immediate answer would be that you have to name your second table: SELECT * FROM DimProductsJOIN (select distinct CarType,CarName from DimProducts) AS secondTableName ------------------------if an answer, mark it so. What I understand from your question is, you ...

Filtering Out Results of one select statement with that of a second select statement
I want to filter out the results of select statement 1 (see below) by the conditions of select statement 2 (see below) I have tried useing nested reports but I can't not group the results by pathologist and specimen class in the main report. Any one have any idea how to go around this. Thanks Select Statement 1 SELECT c_d_person.name as Path, c_d_person.name, c_specimen.specnum_formatted, c_specimen.specimen_id, c_specimen.specclass_id, p_pathologist.primary_flag FROM c_specimen, p_pathologist, ...

Why is the select saying selected after an item is selected?
This was a whitelisting issue due to a software upgrade at hostgator..  Nothing wrong with my code..Scot King SEO Software Tool | Search Engine Optimization"Get your page rank high"  huh? It is smart to put your question in the body and not just in the title. Have no idea what your question is or if it even a question.Eric Pascarello.com | Twitter epascarello | LinkedIn use thisddl.options[ddl.selectedIndex].selected = false; //Clear the selection ddl.options[1].selected = trueMAKMark as Answer if this reply helps youMVP ASP/ASP.NetASP.Net Hosting : Host DepotMy Sit...

Select from another select statement to a repeater
Hi,I have a big problem, I hope you can help me with.What I want:A forum where there is 3 columns Subject, AnswersCount, LastAnswerI have one table with all the data. And two selects functions, where I on the first, get all Subjects for all questions, and on the second select get the Count for all answers on a specific question (with input quiestionId). Both functions works perfect, when I use them seperatly.But I have to go through all rows in the first selection to find the Count What shall I do to that?The code I have now is:The Repeater, where I want to put all data into:<HeaderTempla...

How to select value from another select statement?
Table People (column - Id,Count) Table Skill (column - Id,Skill) first I want to select people who have Skill in "2" select a.Id  from people a, Skill b where a.Id = b.Id and b.skill=2 Result 1 :  Id --- aa bb cc dd ee   and then I want to select which people have a Min(count) from Result 1 how to write a query? combine 2 query into 1 query? thank you   P.S. I'am talking about MSSQL 2000 thank you very much The relationship would be clearer if Table People (column - Id,Count) Table Skill (column - Id,Skill) BecameTable Peop...

Select in Powerbuilder Database painter WORKS but does NOT in Powerbuilder run mode.
I have enclosed the actual information from a debug run. Will apprecaite any hints. Thanks Jim jimo@jdssc.com in ls_mod_string DataWindow.Table.Select="SELECT DISTINCT ~"inv_dtl~".~"inv_id~", ~"inv_dtl~".~"orig_cost~", ~"inv_dtl~".~"last_cost~", ~"inv_dtl~".~"regular_cost~", ~"inv_dtl~".~"orig_price~", ~"inv_dtl~".~"current_price~", ~"inv_dtl~".~"sugg_price~", ~"inv~".~"vend_id~", ~"inv~".~"style~", ~...

Select in Powerbuilder Database painter WORKS but does NOT in Powerbuilder run mode.
I have enclosed the actual information for a debug run. Will apprecaite any hints. Thanks Jim jimo@jdssc.com in ls_mod_string DataWindow.Table.Select="SELECT DISTINCT ~"inv_dtl~".~"inv_id~", ~"inv_dtl~".~"orig_cost~", ~"inv_dtl~".~"last_cost~", ~"inv_dtl~".~"regular_cost~", ~"inv_dtl~".~"orig_price~", ~"inv_dtl~".~"current_price~", ~"inv_dtl~".~"sugg_price~", ~"inv~".~"vend_id~", ~"inv~".~"style~",...

insert select and select into
Hello, I am using temp tables to generate a report. I created most of the temp tables and then use insert select. I found for one, when I use insert select, I get a different query plan than if I use select into. The select into get a much better performance. The problem is I get dead locks on the statement. Is there anything I can do to change this behavior? Thanks, Josh Manfred ...

GridView Selected Row Columns into a coded select statement
I need to retrieve the gridview's selected row columns 0 and 1 values placed into a select statement.  Stumped feel like a shemp     The Select : See the where statement"SELECT E.DISPLAY_NAME, M.SPEC_VALUE FROM MFR_MODEL_SPEC M " & _ "INNER JOIN EQP_PROD_CODE_SPEC E ON M.EQP_PROD_CODE = E.EQP_PROD_CODE AND M.EQP_PROD_CODE_SPEC_SEQ_NUM = E.EQP_PROD_CODE_SPEC_SEQ_NUM " & _ "WHERE (M.MFR_CODE ='Column0') AND (M.MFR_MODEL ='Column1') ORDER BY E.DISPLAY_SEQ" The Grid : <asp:...

Bug in SELECT from SELECT ?
I have a table intwb_items CREATE TABLE intwb_items ( wb_id integer not null, prod_id integer not null, qty numeric(12,5) not null, primary key(wb_id, prod_id) ) How can I obtain sum of 10 greatest "qty"? I tried to execute query: SELECT sum(qty) FROM ( SELECT top 10 qty FROM intwb_items ORDER BY qty DESC )as tmp But it raise error: "Syntax error or access violation: near 'ORDER' in ... FROM intwb_items [ORDER]" The same query but without "ORDER BY" works perfectly, but "TOP N" without "ORDE...

SELECT . FROM ( SELECT .. FROM )
Hi, In application we generate very effective SQL statements that are understandable by MS SQL Server and Oracle but give syntax errors on Sybase. I am talking about SELECT . FROM ( SELECT .. FROM a_table). For example: select 1 from (select abc_id from abc) or select 1 from (select abc_id from abc union all select abc_id from bcd) Is there any way to overcome this limitation? Any help will be greatly appreciated. Leonid Borisov Tefensoft On Wed, 15 May 2002 02:09:52 -0700, Leonid Borisov wrote: > Hi, > > > >...

Select option selection
I'm created a gridview of websites, in one column, and use the gridview's 'selection' featue in the next column. When I click the 'selection' link I tried to get the website by using: Dim key As String = grvPrivacy.Rows(e.RowIndex).Cells(1).Text but it said it was not part of the webcontrol for selection. How do I get cell so that I can read it? thanks   Looks like your grabbing the select option and not the first cell  try  Dim key As String = grvPrivacy.Rows(e.RowIndex).Cells(0).TextwerD, MCSD VB.Net Hi, gmcghee: There are several ways...

Web resources about - select in the select statement - sybase.powerbuilder.database

User:Jimbo Wales/Statement of principles - Wikipedia, the free encyclopedia
As we move forward with software and social changes, I think it is imperative that I state clearly and forcefully my views on openness and the ...

Category:Articles containing potentially dated statements from June 2006 - Wikipedia, the free encyclopedia ...
This is an administration category . It is used for administration of the Wikipedia project and is not part of the encyclopedia. It contains ...

Police Statement Ansell
ABC Home Open Sites menu ABC Home News iview TV Radio Kids Shop More Search Australia Weather News Home Just In Australia National Australian ...

Tamir Rice's Mother Comments on LeBron James Not Giving Statement on Son's Death - Bleacher Report
One week after Cleveland Cavaliers superstar LeBron James made careful comments regarding the death of Tamir Rice, the boy's mother spoke out ...

Mayor Martin Walsh’s statement on Obama gun control initiatives
Mayor Martin Walsh was in Washington, D.C. today during President Obama’s remarks on gun violence. Below is a statement from Mayor Martin Walsh, ...

Is Mark Zuckerberg’s latest post about his daughter a political statement?
... doctor. His captioned it, “ Doctor’s visit — time for vaccines! ” and the post went viral (pun possibly intended.) Seen as an official statement ...

Super Mario Bros World 1-1 Gets Remade to Make Bold Statement About Accessibility
To be honest, I’m not totally sure what to think about this little video , but its heart seems to be in the right place. The creators of the ...

Chipotle sued over food safety statements
Chipotle Mexican Grill was sued for allegedly misleading investors about its food safety controls.

Tesla Drivers Do ‘Crazy Things’ While Autopilot Is Engaged, Musk Issues Statement
... within two years, the Tesla will be able to be "summoned," like Lassie, from miles away.

Wheaton College moving to fire professor after Muslim statements
Wheaton College leaders are taking steps to fire the suspended political science professor who drew fire late last year for saying Christians ...

Resources last updated: 1/14/2016 1:21:58 AM