Ask a Question related to ASP Database, Design and Development.
-
Gurra #1
Selecting multi columns into one ?
I have 3 tables with an ip column that i would like to get into 1 coloumn
with an query
Table 1 columns
ID, IP
Table 2 & 3 columns
FROMID, IP
I would like all ip columns in one column where id or fromid = 1
is that possible ? or could i use a view to make it easier ?
Thanks
/Gustaf
Gurra Guest
-
Why multi Radio buttons are Selecting
Hi, In one of my project I am using 3 Radio buttons for selecting 3 different types of documents. Out of 3 radio buttons I have to select only one... -
Implications for a multi lingual, multi curreny e commerce site ??
Hi I'm about to start wotk on a large e commerce site which is to be multi lingual and support multi currencies. The site needs full content... -
DataGrid: Selecting multiple rows/columns
Hi, I would like to enhance the DataGrid by adding scripting functionality that allows the selection of multiple rows or columns via... -
Form validation for multi-rows and multi-columns
Hello All, I have a classical ASP form with multi-rows and multi-columns that allows users to enter multiple records at once. How do you check... -
Selecting all columns, but in a different order in SELECT statement
Thanks, i thought that was the case... just wanted to confirm it before i started working on it. Alex "Vishal Parkar" <vgparkar@hotmail.com>... -
Ray at #2
Re: Selecting multi columns into one ?
SELECT [col1]+[col2]+[col3] FROM ..."
rs.fields.item(0).value would be how to retreive it.
Or, for the slightly more coder-friendly way:
SELECT [col1]+[col2]+[col3] As [TheCols] FROM ..."
rs.fields.Item("TheCols").Value
If the columns are different datatypes, there may be more to it than those
examples though. We'd have to know what kind of database you're using to
help with handling conversions though, I'd imagine.
Ray at work
"Gurra" <gurgel@telia.com> wrote in message
news:%23RGyslI$DHA.2412@TK2MSFTNGP12.phx.gbl...> I have 3 tables with an ip column that i would like to get into 1 coloumn
> with an query
>
> Table 1 columns
> ID, IP
> Table 2 & 3 columns
> FROMID, IP
>
> I would like all ip columns in one column where id or fromid = 1
>
> is that possible ? or could i use a view to make it easier ?
>
> Thanks
> /Gustaf
>
>
Ray at Guest
-
Jeff Cochran #3
Re: Selecting multi columns into one ?
On Thu, 26 Feb 2004 17:56:00 +0100, "Gurra" <gurgel@telia.com> wrote:
A view might be easier, or you can do a SELECT AS. Something like:>I have 3 tables with an ip column that i would like to get into 1 coloumn
>with an query
>
>Table 1 columns
>ID, IP
>Table 2 & 3 columns
>FROMID, IP
>
>I would like all ip columns in one column where id or fromid = 1
>
>is that possible ? or could i use a view to make it easier ?
SELECT Table1.IP, Table2.IP, Table3.IP AS IPAddresses
WHERE Table1.ID = 1 OR Table2.FROMID = 1 OR Table3.FROMID = 1
If the data types are different between columns you'll have a problem
with this, so then you'd have to retrieve the data set and concatenate
it in your code.
Of course, your display of the recordset would use the IPAddresses
alias instead of a column name. :)
Jeff
Jeff Cochran Guest
-
Aaron Bertrand [MVP] #4
Re: Selecting multi columns into one ?
> SELECT Table1.IP, Table2.IP, Table3.IP AS IPAddresses
I think you meant
SELECT Table1.IP + Table2.IP + Table3.IP AS IPAddresses
or maybe
SELECT Table1.IP + ',' + Table2.IP + ',' + Table3.IP AS IPAddresses
....A
Aaron Bertrand [MVP] Guest
-
Jeff Cochran #5
Re: Selecting multi columns into one ?
On Fri, 27 Feb 2004 00:56:20 -0500, "Aaron Bertrand [MVP]"
<aaron@TRASHaspfaq.com> wrote:
Yup. Gotta remember to think about what I'm doing. :)>>> SELECT Table1.IP, Table2.IP, Table3.IP AS IPAddresses
>I think you meant
>
>SELECT Table1.IP + Table2.IP + Table3.IP AS IPAddresses
Jeff
Jeff Cochran Guest
-
Gurra #6
Re: Selecting multi columns into one ?
Thanks ! :)
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> skrev i
meddelandet news:u3jZGPJ$DHA.3772@TK2MSFTNGP11.phx.gbl...coloumn> SELECT [col1]+[col2]+[col3] FROM ..."
>
> rs.fields.item(0).value would be how to retreive it.
>
> Or, for the slightly more coder-friendly way:
>
> SELECT [col1]+[col2]+[col3] As [TheCols] FROM ..."
>
> rs.fields.Item("TheCols").Value
>
>
> If the columns are different datatypes, there may be more to it than those
> examples though. We'd have to know what kind of database you're using to
> help with handling conversions though, I'd imagine.
>
> Ray at work
>
>
> "Gurra" <gurgel@telia.com> wrote in message
> news:%23RGyslI$DHA.2412@TK2MSFTNGP12.phx.gbl...> > I have 3 tables with an ip column that i would like to get into 1>> > with an query
> >
> > Table 1 columns
> > ID, IP
> > Table 2 & 3 columns
> > FROMID, IP
> >
> > I would like all ip columns in one column where id or fromid = 1
> >
> > is that possible ? or could i use a view to make it easier ?
> >
> > Thanks
> > /Gustaf
> >
> >
>
Gurra Guest
-
Gurra #7
Re: Selecting multi columns into one ?
Thanks ! :)
"Jeff Cochran" <jcochran.nospam@naplesgov.com> skrev i meddelandet
news:403f4b3e.1358049952@msnews.microsoft.com...> On Fri, 27 Feb 2004 00:56:20 -0500, "Aaron Bertrand [MVP]"
> <aaron@TRASHaspfaq.com> wrote:
>>> >> >> SELECT Table1.IP, Table2.IP, Table3.IP AS IPAddresses
> >I think you meant
> >
> >SELECT Table1.IP + Table2.IP + Table3.IP AS IPAddresses
> Yup. Gotta remember to think about what I'm doing. :)
>
> Jeff
Gurra Guest



Reply With Quote

