Thursday, March 22, 2012
compute diffrence
I have a table like this
Code Price Type
1 100 1
2 300 0
1 1500 0
3 50 0
4 100 1
1 50 1
I want to compute the Sum of diffrence price between those rows that have
diffrent Type group by their Code..
How can I do that'
thxselect
(
select sum(price) from tablex group by type
where type=1
) -
(
select sum(price) from tablex group by type
where type=2
)
as difference
"perspolis" wrote:
> Hi all
> I have a table like this
> Code Price Type
> 1 100 1
> 2 300 0
> 1 1500 0
> 3 50 0
> 4 100 1
> 1 50 1
> I want to compute the Sum of diffrence price between those rows that have
> diffrent Type group by their Code..
> How can I do that'
> thx
>
>|||Jose,
Your SQL statement will not compile because you use where after group
by.
> select
> (
> select sum(price) from tablex group by type
> where type=1
> ) -
> (
> select sum(price) from tablex group by type
> where type=2
> )
> as difference
Also, I think the original poster wants the sum of difference between
those rows that have different Type group by their code. Thank you.
"jose g. de jesus jr mcp, mcdba" wrote:
> select
> (
> select sum(price) from tablex group by type
> where type=1
> ) -
> (
> select sum(price) from tablex group by type
> where type=2
> )
> as difference
>
>
> "perspolis" wrote:
>|||sorry no sql here. the idea is there though use subquery
select
(
select sum(price) from tablex where type=1
group by type
) -
(
select sum(price) from tablex where type=2
group by type
)
as difference
"frank chang" wrote:
> Jose,
> Your SQL statement will not compile because you use where after grou
p
> by.
>
> Also, I think the original poster wants the sum of difference between
> those rows that have different Type group by their code. Thank you.
>
> "jose g. de jesus jr mcp, mcdba" wrote:
>|||no that's not right..
I want to group by Code not type
<jose g. de jesus jr mcp>; "mcdba"
<josegdejesusjrmcpmcdba@.discussions.microsoft.com> wrote in message
news:87147408-0BA3-4E4E-8A1F-A6E811A0882D@.microsoft.com...
> sorry no sql here. the idea is there though use subquery
> select
> (
> select sum(price) from tablex where type=1
> group by type
> ) -
> (
> select sum(price) from tablex where type=2
> group by type
> )
> as difference
>
>
> "frank chang" wrote:
>
group
have|||On Tue, 23 Aug 2005 15:35:04 +0430, perspolis wrote:
>Hi all
>I have a table like this
>Code Price Type
> 1 100 1
> 2 300 0
> 1 1500 0
> 3 50 0
> 4 100 1
> 1 50 1
>I want to compute the Sum of diffrence price between those rows that have
>diffrent Type group by their Code..
>How can I do that'
>thx
>
Hi perspolis,
Thanks for posting sample data. Unfortunately, I'm not sure what your
requirements are. Maybe you can improve my understanding by posting the
output you'd expect from the sample data above?
Also, posting the table structure as CREATE TABLE statement and the
sample data as INSERT statements would make it easier for me to test my
solutions.
Check out www.aspfaq.com/5006.
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)|||The output is like this
Code Total
1 1350
2 300
3 50
4 -100
thanks
"Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
news:be5ng1htpq5m0gcgubq8ortulkvs6dcmq0@.
4ax.com...
> On Tue, 23 Aug 2005 15:35:04 +0430, perspolis wrote:
>
> Hi perspolis,
> Thanks for posting sample data. Unfortunately, I'm not sure what your
> requirements are. Maybe you can improve my understanding by posting the
> output you'd expect from the sample data above?
> Also, posting the table structure as CREATE TABLE statement and the
> sample data as INSERT statements would make it easier for me to test my
> solutions.
> Check out www.aspfaq.com/5006.
> Best, Hugo
> --
> (Remove _NO_ and _SPAM_ to get my e-mail address)|||can you pls enlightened me more
how did code 1 got 1350 and
how did 4 get -100
"perspolis" wrote:
> The output is like this
> Code Total
> 1 1350
> 2 300
> 3 50
> 4 -100
> thanks
> "Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
> news:be5ng1htpq5m0gcgubq8ortulkvs6dcmq0@.
4ax.com...
>
>|||to get this output for example for Code 1
Add Sum(Price) of those rows with Type=0 and Code=1 minus Sum( Price) of
those rows with Type=1 and Code=1 to get 1500-(100+50)= 1350 for
Code=1
"jose g. de jesus jr mcp, mcdba"
<josegdejesusjrmcpmcdba@.discussions.microsoft.com> wrote in message
news:4CF3C365-1AA9-4417-AF1F-2346915FE922@.microsoft.com...
> can you pls enlightened me more
> how did code 1 got 1350 and
> how did 4 get -100
>
> "perspolis" wrote:
>|||persoplis, This is a first cut but it shows the desired results
select a1.code, a1.sumprice - a2.sumprice
FROM (select t1.code, sum(t1.price) as sumprice from xyz t1
group by t1.code, t1.type ) AS a1
JOIN
(select t1.code, sum(t1.price) as sumprice from xyz t1
group by t1.code, t1.type ) AS a2
ON a1.code = a2.code and a1.sumprice > a2.sumprice
UNION
select a1.code, a1.sumprice
from (select t1.code, sum(t1.price) as sumprice from xyz t1
group by t1.code, t1.type ) AS a1
where (select count(*) from
(select t1.code, sum(t1.price) as sumprice from xyz t1
group by t1.code, t1.type ) AS a2
where a1.code = a2.code) = 1
This is the DDL I used:
Create Table XYZ
(
Code int,
Price int,
Type int
)
go
INSERT into XYZ values (1,100,1)
INSERT into XYZ values (2,300,0)
INSERT into XYZ values (1,1500,0)
INSERT into XYZ values (3,50,0)
INSERT into XYZ values (4,100,1)
INSERT into XYZ values (1,50,1)
INSERT into XYZ values (5,200,1)
INSERT into XYZ values (5,2500,0)
INSERT into XYZ values (5,250,1)
go
"perspolis" wrote:
> The output is like this
> Code Total
> 1 1350
> 2 300
> 3 50
> 4 -100
> thanks
> "Hugo Kornelis" <hugo@.pe_NO_rFact.in_SPAM_fo> wrote in message
> news:be5ng1htpq5m0gcgubq8ortulkvs6dcmq0@.
4ax.com...
>
>
Tuesday, March 20, 2012
compression for log shipping
I am using the Simple Log Shipping in the SQL resource kit.
just wondering if there is any way I can compress the log during the log
shipping processing?
thanks
Justin
Nope. SQL Server does not support compressing backups. Why? I have
absolutely no idea at all. Want it in the product? Get a few thousand of
your friends to make it an issue to add the feature.
http://lab.msdn.microsoft.com/produc...k/Default.aspx
Mike
Mentor
Solid Quality Learning
http://www.solidqualitylearning.com
"Justin" <justin@.innocity.net> wrote in message
news:eDd$b91CGHA.3140@.TK2MSFTNGP14.phx.gbl...
> Hi All
> I am using the Simple Log Shipping in the SQL resource kit.
> just wondering if there is any way I can compress the log during the log
> shipping processing?
> thanks
> Justin
|||As Michael mentioned, the is no compressing support in the Sql2005 release.
This feature has been considered for the future release though.
Thanks
Yunwen
Disclaimer: This posting is provided “AS IS” with no warranties, and confers
no rights. You assume all risk for your use.
"Michael Hotek" wrote:
> Nope. SQL Server does not support compressing backups. Why? I have
> absolutely no idea at all. Want it in the product? Get a few thousand of
> your friends to make it an issue to add the feature.
> http://lab.msdn.microsoft.com/produc...k/Default.aspx
> --
> Mike
> Mentor
> Solid Quality Learning
> http://www.solidqualitylearning.com
>
> "Justin" <justin@.innocity.net> wrote in message
> news:eDd$b91CGHA.3140@.TK2MSFTNGP14.phx.gbl...
>
>
Thursday, March 8, 2012
complex SQL select query
Hi all
I im trying to write a SELECT query to display a set of my logged in user's 'Friends'. Although the way that i have designed my tables means that its very complex, and im hoping someone out there can tackle it!
To start ill show you how i contruct friends:
Friends
FriendshipID Incrementing PK
InviteeID Unique UserID of person who offered the friendship link
InvitedID Unique UserID of person who was invites
ApprovedBInvitee True/False - sets to 'True' by default (probably isnt needed come to think of it)
ApprovedByInvited True/False/Declined - an nvarchar
Next, I have my UserDetails table:
UserDetails
UserID Unique UserID PK
UserName Unique Username (foreign key from aspnet_Users as created by aspnet_regsql.exe)
Avatar Integer which represents an image name in a photos folder
So, on the myFriends.aspx i firstly set an invisible label's text property to the unique UserID of the logged in user. This gives me a control paremater for the select statement.
The information I want to display is just the UserName and Avatar of all users who are friends with the logged in user.
I know that to get the records where the logged in user is either that Invited or the Invitee, I do this:
WHERE (@.loggedInUser = Friends.IniteeID)OR (@.loggedInUser = Friends.InvitedID)
(that will show the logged in user as his own friend but i dont mind that)
After that I am stuck more or less... it seems to become very complex... maybe i need 2 queries?
If anyone can help i would be very very grateful
This is actually a very simple query... it may seem a bit complex because you join back twice on the user class... actually, you don't *have* to do that... there are many ways to accomplish this.
SELECT
friendUsers.UserName,
friendUsers.Avatar
FROM
dbo.UserDetails u INNER JOIN dbo.Friends f
ON u.UserID = f.InviteeID OR u.UserID = f.InvitedID
INNER JOIN dbo.UserDetails friendUsers
ON friendUser.UserID = f.InviteeID OR friendUser.UserID = f.InvitedID
WHERE
u.UserID = @.loggedInUser
That should work.
|||Another way to do it would be this:
SELECT UserName, Avatar FROM dbo.UserDetails
WHERE UserID IN (SELECT UserID FROM dbo.UserDetails, dbo.Friends WHERE UserID = InviteeID OR UserID = InvitedID)
Believe it or not, those are the same query.
|||
Nullable:
SELECT UserName, Avatar FROM dbo.UserDetails
WHERE UserID IN (SELECT UserID FROM dbo.UserDetails, dbo.Friends WHERE UserID = InviteeID OR UserID = InvitedID)
I forgot one more piece to filter down by the current user:
SELECT UserName, Avatar FROM dbo.UserDetails
WHERE UserID IN (SELECT UserID FROM dbo.UserDetails, dbo.Friends WHERE UserID = @.loggedInUser AND (UserID = InviteeID OR UserID = InvitedID))
There :)
|||Hi Nullable
Thanks for the rsponse, you obviously have more skills with sql than me!
I have tried the corrected second query:
SELECT UserName, Avatar FROM dbo.UserDetails
WHERE UserID IN (SELECT UserID FROM dbo.UserDetails, dbo.Friends WHERE UserID = @.loggedInUser AND (UserID = InviteeID OR UserID = InvitedID))
There is only one friends entry at the moment, one where the logged in userid will be the InvitedID (although that will not always be the case of course)
...that query is returning the Avatar and UserName of that user - the logged in one - rather than those of his friend. We need to stick a WHERE ApprovedByInvited = 'True' too, but i think i can manage that.
Do you know why we are getting the wrong user details?
Thanks again
|||I would recommend a query with a JOIN than with an IN because JOIN works faster. IN is like looking for each value in the IN clause separately. JOIN is like a batch.|||- Good book knowledge, but unless you run the execution plan on the two and look at the subtree cost, you wouldn't want to make this statement.
ndinakar:
I would recommend a query with a JOIN than with an IN because JOIN works faster. IN is like looking for each value in the IN clause separately. JOIN is like a batch.
I'll look into the query again to see where I crossed wires :)
|||Heh, my "correction" to my earlier query was done in much haste and not thought out :) ... it was close, but not quite right:
SELECT UserName, Avatar FROM dbo.UserDetails
WHERE UserID IN (SELECT UserID FROM dbo.UserDetails, dbo.Friends WHEREUserID = @.loggedInUser AND (UserID = InviteeID OR UserID = InvitedID))
That is forcing only the current user... which was pretty dumb
SELECT UserName, Avatar FROM dbo.UserDetails
WHERE UserID IN (SELECT UserID FROM dbo.UserDetails, dbo.Friends WHERE UserID != @.loggedInUser
AND (UserID = InviteeID OR UserID = InvitedID) AND (@.loggedInUser= InviteeID OR @.loggedInUser= InvitedID))
To read that in English you would say "Give me the UserName and Avatar FROM the UsersDetails Table WHERE the user that I'm looking at is part of the following list: (Give me all Users who are linked in the friend table WHERE either the user is the Invitee OR the user is the Invited AND the loggedInUser is an Invitee OR the loggedInUser is the Invited)"
Got it? Good :) (Please make sure to mark one of these posts as the answer when you're done so that I know this issue has been resolved.)
Peace,
|||- Sorry to correct you like that, I don't mean to seem rude, so here is a quick explaination into why I corrected you.
Nullable:
- Good book knowledge, but unless you run the execution plan on the two and look at the subtree cost, you wouldn't want to make this statement.
ndinakar:
I would recommend a query with a JOIN than with an IN because JOIN works faster. IN is like looking for each value in the IN clause separately. JOIN is like a batch.
SELECT
c.*FROM dbo.SysColumns cINNERJOIN dbo.SysObjects oON c.id= o.id-- Subtree Cost : 0.0317435
SELECT
*FROM dbo.SysColumns cWHERE idIN(SELECT idFROM dbo.SysObjects)-- Subtree Cost : 0.0317125These two queries will return the EXACT same result set... but the one with the JOIN is actually slightly more expensive (and takes longer) to run... Do you know why? Well, to put it very simply and I will probably be "corrected" on this explaination... but here goes: The RESULTS of the query were only from the SysColumns table... so joining the two (thereby forcing SQL to have to ORDER the SysObjects table by ID to do it's cross streaming) is more expensive than the second query which only needed to get the list of IDs (in any order) from the SysObjects table.
As a punishment for your crime, you must go tohttp://www.SingingEels.com and spread the word!
|||Thank you nullable and French Duke, I must try to reproduce this myself with varying amounts of test data.|||
Hey Timothy
Thanks bro, thats done the job just nicely. Marked you up
|||
Nullable:
- Sorry to correct you like that, I don't mean to seem rude, so here is a quick explaination into why I corrected you.
Nullable:
- Good book knowledge, but unless you run the execution plan on the two and look at the subtree cost, you wouldn't want to make this statement.
ndinakar:
I would recommend a query with a JOIN than with an IN because JOIN works faster. IN is like looking for each value in the IN clause separately. JOIN is like a batch.
SELECT
c.*FROM dbo.SysColumns cINNERJOIN dbo.SysObjects oON c.id= o.id
-- Subtree Cost : 0.0317435SELECT
*FROM dbo.SysColumns cWHERE idIN(SELECT idFROM dbo.SysObjects)
-- Subtree Cost : 0.0317125These two queries will return the EXACT same result set... but the one with the JOIN is actually slightly more expensive (and takes longer) to run... Do you know why? Well, to put it very simply and I will probably be "corrected" on this explaination... but here goes: The RESULTS of the query were only from the SysColumns table... so joining the two (thereby forcing SQL to have to ORDER the SysObjects table by ID to do it's cross streaming) is more expensive than the second query which only needed to get the list of IDs (in any order) from the SysObjects table.As a punishment for your crime, you must go tohttp://www.SingingEels.com and spread the word!
Here's one article that I could find with peformance issues with IN:http://support.microsoft.com/kb/829205|||
Just recollected that the queries work differently if you have duplicate records in the subquery table. If your subquery has more records (like a 1-many relationship) doing a JOIN will return multiple records where as an IN might return only one record.
Sunday, February 12, 2012
Comparison of words within a column using "Like" keyword
I have got a problem, when I use this query it returns the expected results
select * from tbl_list
where keyword like '%' + 'abc' + '%'
but when I use the same in stored procedure, it returns unexpected results:
my stored procedure is this
Create proc sp_getlist
@.keyword varchar(2000)
as
select * from tbl_list
where keyword like '%' + @.keyword + '%'
I'm Using SQl Server 2000 (Personal Addition) on Windows XP SP2.
Please help me out, thanx in anticipation.Hi Zubair,
What is the kind of result that u are getting. Can you please display a
sample output and the kind of input that u are sending to the Stored Procedu
re
thanks and regards
Chandra
"zubair" wrote:
> Hello all!
> I have got a problem, when I use this query it returns the expected result
s
> select * from tbl_list
> where keyword like '%' + 'abc' + '%'
> but when I use the same in stored procedure, it returns unexpected results
:
> my stored procedure is this
> Create proc sp_getlist
> @.keyword varchar(2000)
> as
> select * from tbl_list
> where keyword like '%' + @.keyword + '%'
> I'm Using SQl Server 2000 (Personal Addition) on Windows XP SP2.
> Please help me out, thanx in anticipation.
>
>
Friday, February 10, 2012
Comparision on Char Column With Alphanumeric Values
I am using SQL Server 2000.
I have a table which a column ID(Char(13)). The column has values varying
from BBB, AAA, , 432990098C,432990164C, 4329999999999 and so on. When i try
to retrieve records from the
table using a query like
Select * From myTable Where Id >='43299AAAAAAAA' AND Id<='4329999999999'
The query returns 0 records, whereas ideally it should return records with
values like '432999098C','432990164C' and so on.
I have tried all the different collations on the table column but with no
success.
Can some sql guru help me on this.
TIACheck your expression again - look at this:
IF '43299AAAAAAAA' <= '4329999999999'
PRINT 'True'
ELSE
PRINT 'False'
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Vaibhav" <consultvaibhav@.yahoo.com> wrote in message
news:OeV6ZIGwEHA.200@.TK2MSFTNGP11.phx.gbl...
> Hi All
> I am using SQL Server 2000.
> I have a table which a column ID(Char(13)). The column has values varying
> from BBB, AAA, , 432990098C,432990164C, 4329999999999 and so on. When i
try
> to retrieve records from the
> table using a query like
> Select * From myTable Where Id >='43299AAAAAAAA' AND Id<='4329999999999'
> The query returns 0 records, whereas ideally it should return records with
> values like '432999098C','432990164C' and so on.
> I have tried all the different collations on the table column but with no
> success.
> Can some sql guru help me on this.
> TIA
>|||Thank you for the reponse and you are right the expression would always
evaluate to false and therfore no records are returned.
But the same type of expressions evalutes to true when executed against a
IBM-DB2 database ans returns records as required, Why is that ?
Is there any way where the expression as mentioned by you, would evaluate to
'True' in MS-SQL server and thus return records.
TIA
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:OxD9rjKwEHA.4004@.tk2msftngp13.phx.gbl...
> Check your expression again - look at this:
> IF '43299AAAAAAAA' <= '4329999999999'
> PRINT 'True'
> ELSE
> PRINT 'False'
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "Vaibhav" <consultvaibhav@.yahoo.com> wrote in message
> news:OeV6ZIGwEHA.200@.TK2MSFTNGP11.phx.gbl...
> try
>|||I guess there must be some sort order where alfa characters have lower ASCII
number that numbers.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Vaibhav" <consultvaibhav@.yahoo.com> wrote in message
news:uqIlscOwEHA.356@.TK2MSFTNGP10.phx.gbl...
> Thank you for the reponse and you are right the expression would always
> evaluate to false and therfore no records are returned.
> But the same type of expressions evalutes to true when executed against a
> IBM-DB2 database ans returns records as required, Why is that ?
> Is there any way where the expression as mentioned by you, would evaluate
to
> 'True' in MS-SQL server and thus return records.
> TIA
>
> "Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
> message news:OxD9rjKwEHA.4004@.tk2msftngp13.phx.gbl...
varying[vbcol=seagreen]
Id<='4329999999999'[vbcol=seagreen]
no[vbcol=seagreen]
>|||IF '43299AAAAAAAA' <= '4329999999999' collate SQL_EBCDIC273_CP1_CS_AS
PRINT 'True'
ELSE
PRINT 'False'
I have no idea what the EBCDIC collations do in detail, but they at
least answer this question to the poster's satisfaction.
SK
Dejan Sarka wrote:
>I guess there must be some sort order where alfa characters have lower ASCI
I
>number that numbers.
>
>|||THANKS A LOT !!!!!!!!!
SALUTE THE GURU!
"Steve Kass" <skass@.drew.edu> wrote in message
news:4187B2F1.8030001@.drew.edu...[vbcol=seagreen]
> IF '43299AAAAAAAA' <= '4329999999999' collate SQL_EBCDIC273_CP1_CS_AS
> PRINT 'True'
> ELSE
> PRINT 'False'
> I have no idea what the EBCDIC collations do in detail, but they at least
> answer this question to the poster's satisfaction.
> SK
> Dejan Sarka wrote:
>
Comparision on Char Column With Alphanumeric Values
I am using SQL Server 2000.
I have a table which a column ID(Char(13)). The column has values varying
from BBB, AAA, , 432990098C,432990164C, 4329999999999 and so on. When i try
to retrieve records from the
table using a query like
Select * From myTable Where Id >='43299AAAAAAAA' AND Id<='4329999999999'
The query returns 0 records, whereas ideally it should return records with
values like '432999098C','432990164C' and so on.
I have tried all the different collations on the table column but with no
success.
Can some sql guru help me on this.
TIA
Check your expression again - look at this:
IF '43299AAAAAAAA' <= '4329999999999'
PRINT 'True'
ELSE
PRINT 'False'
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Vaibhav" <consultvaibhav@.yahoo.com> wrote in message
news:OeV6ZIGwEHA.200@.TK2MSFTNGP11.phx.gbl...
> Hi All
> I am using SQL Server 2000.
> I have a table which a column ID(Char(13)). The column has values varying
> from BBB, AAA, , 432990098C,432990164C, 4329999999999 and so on. When i
try
> to retrieve records from the
> table using a query like
> Select * From myTable Where Id >='43299AAAAAAAA' AND Id<='4329999999999'
> The query returns 0 records, whereas ideally it should return records with
> values like '432999098C','432990164C' and so on.
> I have tried all the different collations on the table column but with no
> success.
> Can some sql guru help me on this.
> TIA
>
|||Thank you for the reponse and you are right the expression would always
evaluate to false and therfore no records are returned.
But the same type of expressions evalutes to true when executed against a
IBM-DB2 database ans returns records as required, Why is that ?
Is there any way where the expression as mentioned by you, would evaluate to
'True' in MS-SQL server and thus return records.
TIA
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si > wrote in
message news:OxD9rjKwEHA.4004@.tk2msftngp13.phx.gbl...
> Check your expression again - look at this:
> IF '43299AAAAAAAA' <= '4329999999999'
> PRINT 'True'
> ELSE
> PRINT 'False'
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "Vaibhav" <consultvaibhav@.yahoo.com> wrote in message
> news:OeV6ZIGwEHA.200@.TK2MSFTNGP11.phx.gbl...
> try
>
|||I guess there must be some sort order where alfa characters have lower ASCII
number that numbers.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Vaibhav" <consultvaibhav@.yahoo.com> wrote in message
news:uqIlscOwEHA.356@.TK2MSFTNGP10.phx.gbl...
> Thank you for the reponse and you are right the expression would always
> evaluate to false and therfore no records are returned.
> But the same type of expressions evalutes to true when executed against a
> IBM-DB2 database ans returns records as required, Why is that ?
> Is there any way where the expression as mentioned by you, would evaluate
to[vbcol=seagreen]
> 'True' in MS-SQL server and thus return records.
> TIA
>
> "Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si > wrote in
> message news:OxD9rjKwEHA.4004@.tk2msftngp13.phx.gbl...
varying[vbcol=seagreen]
Id<='4329999999999'[vbcol=seagreen]
no
>
|||IF '43299AAAAAAAA' <= '4329999999999' collate SQL_EBCDIC273_CP1_CS_AS
PRINT 'True'
ELSE
PRINT 'False'
I have no idea what the EBCDIC collations do in detail, but they at
least answer this question to the poster's satisfaction.
SK
Dejan Sarka wrote:
>I guess there must be some sort order where alfa characters have lower ASCII
>number that numbers.
>
>
|||THANKS A LOT !!!!!!!!!
SALUTE THE GURU!
"Steve Kass" <skass@.drew.edu> wrote in message
news:4187B2F1.8030001@.drew.edu...[vbcol=seagreen]
> IF '43299AAAAAAAA' <= '4329999999999' collate SQL_EBCDIC273_CP1_CS_AS
> PRINT 'True'
> ELSE
> PRINT 'False'
> I have no idea what the EBCDIC collations do in detail, but they at least
> answer this question to the poster's satisfaction.
> SK
> Dejan Sarka wrote: