Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Simple SQL Question
You could try something like
select distinct(a||b) from yourTable
but I agree that the design should be looked at. The distinct will cause a lot of sorting even if you create a composite index on A,B. My sample table only had those 2 columns with the index and 3 total rows. I still ended up with a full table scan using RBO.
Jeff Anderson <jeanderso9_at_yahoo.com> wrote in message
news:raji6.127909$9v2.1661044_at_quark.idirect.com...
> Is there a simple way to query a table whose records are formatted as
> follows:
>
> FIELD1 VARCHAR(12) - Ex. Data: NORTH
> FIELD2 VARCHAR(12) - Ex. Data: 1000
> FIELD3 VARCHAR(12) - Ex. Data: 2000
> FIELD4 VARCHAR(12) - Ex. Data: 3000
>
> with a result set that contains multiple records in the following format:
>
> NORTH 1000
> NORTH 2000
> NORTH 3000
>
> without doing a UNION? We're trying to avoid changing the table structure
> and the overhead of runniing UNION statements.
>
> Thanks.
>
>
>
>
Received on Wed Feb 14 2001 - 09:28:44 CST
![]() |
![]() |