Hi there,
just want to find out if it's possible to extract 2 different values with 1 select statement?
I need to extract values from a table, according to a specific condition...
eg: to extract values from tableA where "office_name" = "o_id" from tableB, where tableA is the one with the primary key... and then select the office from tableA where the "officeid"=0, and populate that in the same result set...
so that it can be populated in a <asp:DropDownList> control, and then be bound to the control based on the DataValueField, and DataTextField
is it possible, or not?
thx
SJB
Hi,
Do you want more than one row, or simply only 1 ?
If you are ok with multiple rows you can just do a UNION between the single queries.
SELECT SomeName
FROM SomeTable
INNER JOIN <YourJoin>
UNION
SELECT SomeName
FROM SomeOtherTable
WHERE <condition>
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||thanks, I'll have look into it, I haven't tried in, but I will have a look, and see what happens... thx
No comments:
Post a Comment