microsoft newsgroup web access
     dot net    |    ms sql    |    ms access    |    office    |    windows    |   
Microsoft ms sql group
sqlserver.ce
sqlserver.clients
sqlserver.clustering
sqlserver.connect
sqlserver.datawarehouse
sqlserver.dts
sqlserver.fulltext
sqlserver.msde
sqlserver.mseq
sqlserver.notificationsvcs
sqlserver.odbc
sqlserver.olap
sqlserver.programming
sqlserver.replication
sqlserver.reportingsvcs
sqlserver.security
sqlserver.server
sqlserver.setup
sqlserver.tools
sqlserver.xml
  
    

Re: SQL query question



Thanks, Bob. I'll try it.



"metoonyc" wrote in message
news:uKqMynb#EHA.4072@TK2MSFTNGP10.phx.gbl...
> Hi all,
>
> I need to create a view in sql7,
>
> The table look like this:
> field1 field2 field3
> A abc/xyz 500.00
> B mnc/opq 255.00
> C xyz/abc 550.00
> D opq/mnc 123.00
> E hnc/yun 25.00
> F inm/mnb 453.00
>
> I want the view look like this,
>
> Field1 field2 field3
>
> A abc/xyz 500.00
> C xyz/abc 550.00
> B mnc/opq 255.00
> D opq/mnc 123.00
> F inm/mnb 453.00
> E hnc/yun 25.00
>
> Basically, I need to abc/xyz and xyz/abc, mnc/opq and opq/mnc in order.
>
> Any ideas?
>
> thanks in advance
>
>
>
>




Fri, 14 Jan 2005 11:14:26 -0500 "metoonyc"

Re: SQL query question



Bob,

The performance is real bad


"metoonyc" wrote in message
news:uKqMynb#EHA.4072@TK2MSFTNGP10.phx.gbl...
> Hi all,
>
> I need to create a view in sql7,
>
> The table look like this:
> field1 field2 field3
> A abc/xyz 500.00
> B mnc/opq 255.00
> C xyz/abc 550.00
> D opq/mnc 123.00
> E hnc/yun 25.00
> F inm/mnb 453.00
>
> I want the view look like this,
>
> Field1 field2 field3
>
> A abc/xyz 500.00
> C xyz/abc 550.00
> B mnc/opq 255.00
> D opq/mnc 123.00
> F inm/mnb 453.00
>


Fri, 14 Jan 2005 14:00:17 -0500 "metoonyc"

sql query question



Hi all,

I need to create a view in sql7,

The table look like this:
field1 field2 field3
A abc/xyz 500.00
B mnc/opq 255.00
C xyz/abc 550.00
D opq/mnc 123.00
E hnc/yun 25.00
F inm/mnb 453.00

I want the view look like this,

Field1 field2 field3

A abc/xyz 500.00
C xyz/abc 550.00
B mnc/opq 255.00
D opq/mnc 123.00
F inm/mnb 453.00
E hnc/yun 25.00

Basically, I need to abc/xyz and xyz/abc, mnc/opq and opq/mnc in order.

Any ideas?

thanks in advance





220 500638 <#ngipum#EHA.2316@TK2MSFTNGP15.phx.gbl>
From: "metoony

Fri, 14 Jan 2005 14:01:16 -0500 "metoonyc"

Re: SQL query question



> Bob,
>
> The performance is real bad
>


:-)
Really? That's good! I was afraid the performance would be really horrible!
But only "real bad", well, all I can say is that's a relief ;-)

Seriously, I did warn you. SQL Server has absolutely no chance of optimizing
a query that orders by portions of a single column. You're only hope of
improving the performance is to normalize this table design and break the
discrete pieces of data out into their own columns. Even then, it's going to
be tough to optimize due to the need to choose which column to order by.

Bob Barrows

PS. Please reply to the message to which you are replying instead of
replying to your origi

Fri, 14 Jan 2005 14:21:18 -0500 "Bob Barrows [MVP]"

Re: sql query question



BY DEFINITION, a view is a table and a table has no ordering. That
would make it a sequential file. And sequential files have fields,
while tables have columns -- totally different concepts.

Please post DDL, so that people do not have to guess what the keys,
constr

14 Jan 2005 11:26:33 -0800 "--CELKO--"

RE: sql query question



Not exactly but close.

use tempdb
go

declare @t table (
colA char(1),
colB varchar(25),
colC decimal(6, 2)
)

insert into @t values('A', 'abc/xyz', 500.00)
insert into @t values('B', 'mnc/opq', 255.00)
insert into @t values('C', 'xyz/abc', 550.00)
insert into @t values('D', 'opq/mnc', 123.00)
insert into @t values('E', 'hnc/yun', 25.00)
insert into @t values('F', 'inm/mnb', 453.00)

select
a.colA,
a.colB,
a.colC
from
@t as a
order by
case whe

Fri, 14 Jan 2005 11:41:06 -0800 "=?Utf-8?B?QWxlamFuZHJvIE1lc2E=?="

Re: sql query question



metoonyc wrote:
> Hi all,
>
> I need to create a view in sql7,
>
> The table look like this:
> field1 field2 field3
> A abc/xyz 500.00
> B mnc/opq 255.00
> C xyz/abc 550.00
> D opq/mnc 123.00
> E hnc/yun 25.00
> F inm/mnb 453.00
>
> I want the view look like this,
>
> Field1 field2 field3
>
> A abc/xyz 500.00
> C xyz/abc 550.00
> B mnc/opq 255.00
> D opq/mnc 123.00
> F inm/mnb 453.00
> E


Fri, 14 Jan 2005 13:46:19 -0600 Zach Wells


COPYRIGHT © 2004, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE
http://www.meetholland.com

advertisement:   complete list of microsoft newsgroup    |    uk based newsgroup    |