Viewing 15 posts - 26,296 through 26,310 (of 26,487 total)
But you could do this:
SELECT SUM(x),
case when name LIKE 'Z%' then 'NA' else name end as cust
FROM foo
GROUP BY case when name LIKE 'Z%' then 'NA' else name end...
November 15, 2006 at 8:55 pm
The challenge did not talk about functions on the left side of the SARG. Anyone familiar with MS SQL Server knows that if you put a function on the left...
November 15, 2006 at 4:23 pm
Actually, syntax does matter. How DB2 handles the use of functions can be significantly different than how MS SQL Server does. Yes, with MS SQL Server, it does matter where...
November 15, 2006 at 2:55 pm
Unfortunately, that is DB2 syntax. You have to use T-SQL syntax with MS SQL Server. Even in your own code you used T-SQL.
Original post:
The DB2 equivalent would be:
select * from...
November 15, 2006 at 2:25 pm
Since you are using a temp (#) table, change them from a local temp table (#) to a global temp table (##).
hth
Lynn
November 15, 2006 at 10:01 am
An update:
1st, Edwin's query was this:
Select * From Table
Where Date(timestamp_column) >= DateAdd(Day, 1, DateAdd(Month, -1, Convert(Char(10), GetDate(), 120)))
I don't see where you included this query into your test.
You remind me...
November 15, 2006 at 9:41 am
Using your own terms:
Challenge met!
Oh, I get it, if the results don't match what is expected, change the requirements of the challenge!
I met the requirements, 100000 records in the table. Pulled...
November 15, 2006 at 7:58 am
Sergiy,
I took your challenge and created a table (actually 2) with 100000 rows. I then used 2 queries one using Edwin's method of determining the starting date and one with...
November 14, 2006 at 11:47 pm
Sergiy,
Tactfully pointing out a better way of doing things is one thing. The way you approached this particular situation was anything but tactful. Using words like "stupid", '"liar", etc. is not...
November 14, 2006 at 5:47 pm
Edwin,
Personally, I'd rather get it right first then work on enhancing performance. If doing a date conversion in a query makes it clearer what you are trying to do, then...
November 14, 2006 at 3:05 pm
Looking at BOL, you need to but the dd in double quotes: "dd"
November 14, 2006 at 2:18 pm
There are several ways to change fields. In place as was originally provided; using a temporary table; and a third is to add two new columns, copy the data from...
November 14, 2006 at 2:14 pm
Just an alternative, and it ensures you don't lose data if that is a concern.
November 14, 2006 at 1:42 pm
Another alternative to try in development first is this:
1. Create a new table called tmp_tablename that is identical to your existing table, but with the columns your are changing defined...
November 14, 2006 at 1:20 pm
Not sure if this will work as advertised, but it is worth a try:
select
a.*,
b.pob_system_date,
b.pob_company,
b.pob_site,
b.pob_po_nbr,
b.pob_line_nbr
from
dbo.SALES a
left join dbo.PO b
on (a.company = b.pob_so_company...
November 14, 2006 at 1:05 pm
Viewing 15 posts - 26,296 through 26,310 (of 26,487 total)