SELECT from SELECTHi!
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...
DataGrid Rollover Colors, select single, select multiple rows client side
Iam just adding some more lines to JakeJeck's post http://forums.asp.net/792635/ShowPost.aspx
Put this in a class file
public static DataGridItem
ApplyRowRollover(DataGridItem item , string MouseOverColor , string
MouseOutColor, string MouseClickColor )
{
item.Attributes.Add("onmouseover", "ChangeColorOver(this,'" +
MouseOverColor + "','" + MouseClickColor + "');");
 ...
insert select and select intoHello,
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
...
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,
>
>
>
>...
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 in the select statementHi,
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
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" <...
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...
Select in the select clauseHow to use another select clause within a select clause itself.
Like;
select col1,col2,(select colx from table b) from table a .
The above statement is throwing syntax error
Thanks,
Anandkumar B CGVAK Software & Exports Ltd. ( 0422 2434491/92
http://www.cgvakindia.com
"anand_group" <anand@cgvakindia.com> wrote:
> How to use another select clause within a select clause itself.
> Like;
> select col1,col2,(select colx from table b) from table a .
> The above statement is throwing syntax error
Ensure that subquery returns only one row. And...
Dynamic DropDownList Default Selected Item Does Not Select Default Item
I have some dynamic listbox code that creates a listbox based on information stored in a database. The database access works fine. The only issue is that when I use the lbNew.Items.FindByValue(...).Selected = True line, no default select is made. The listbox just defaults to the first item in the list.lbNew = New DropDownList
' Scans for the list source.
' If "values_table" returns the first character = '@',
' then a table is the datasource.
strDataSourceTable = Nothing
strDataSourceTable = objDataReader.Item("values_table")
' If there is a data list, display the item, else ig...
Selecting the default selected Item in RadiobuttonList
Is it possible to set the default item selected of radiobuttonlist from code behind while he page loads. I have been trying this with its method and properties but yet to get it right: this is the code<asp:RadioButtonList ID="rdlSetting" runat="server" RepeatColumns="2" RepeatDirection="Vertical" RepeatLayout="Table"><asp:ListItem Text="Public" Value="0"></asp:ListItem><asp:ListItem Text="Private" Value="1"></asp:ListItem></asp:RadioButtonList>from COde behindon...
How do I select an pre-selected dropdownlist item?
I have a dropdownlist for which I want to select the item previous selected, and the item id is a request.querystring item. How do I do that?
dim selecteditem as string
selecteditem = request.querystring(".....")
dpTest.Items.FindByValue(selecteditem).Selected = True***********************Dinakar NethiLife is short. Enjoy it.***********************
Thanks !...
dropdownlist: select selected item during update
Hi,
I have a datalist (databound) with notes ralated to persons. (Every note has one person). When I want to update a note, there is a drop downlist with al persons from the database (databound). The dropdownlist is created during the OnDataBind event of the datalist.
But I want to select the previously selected person in the dropdownlist. (probably with dropdownlist.SelectedIndex). That is when the personID from the note is the same as the personID in the onDataBind of the dropdownlist.
protected void dlLogboek_Ondatabind(object sender, DataListItemEventArgs e)
{
DropDownList ddlCpers...
Problems selecting the selected item in a Listbox
Hi All,I've got two listboxes which I want to allow a user to move items from one to the other. I do the population of the first list during the initial page load and bind the results to the first listbox. I have a button which does the move of the selected item to the second listbox.The problem is when I select an item then click the move button it always moves the first item in the list even if that item is not selected, and never moves the selected item.I've checked that during the postback the listbox is not being repopulated, and it isn't. Any help very much appreciated! thanks....and t...
Dropdownbox - selected item
I have a database field i.e. intLocationID that checks to see if it is found in dropdownbox, if not it should select NONE SELECTED. Below works if the intLocationID matches, but bombs if it doesnt. I want to be able to just select NONE SELECTED if it is not found. Any help... Thanks
objCommand.CommandType = CommandType.StoredProcedure
objCommand.ExecuteNonQuery()
objSqlDataReader = objCommand.ExecuteReader()
cboLocation.DataSource() = objSqlDataReader
cboLocation.DataTextField = "LOCATION_NAME&...