Viewing 15 posts - 31 through 45 (of 68 total)
Thanks coffee:-D. But can you rewrite with out subquery or CTE?
April 26, 2010 at 12:27 am
:w00t: oh, good SQL. I'm rewrite your SQL and...
SELECT
CASE WHEN (@Date % 100) = 12 THEN
@Date + 89
ELSE
@Date + 1
END
Thanks for your support, 😀
Any one else,...
April 16, 2010 at 12:39 am
@skcadavre
Thanks for help.
I think i will process it in form.
April 15, 2010 at 3:39 am
I want to select data to out to file. So I do that.
April 15, 2010 at 3:10 am
:-D, in this case, i want to get 2 column with CODE=1 but case when CODE=1 one time, huhu
April 12, 2010 at 8:39 pm
Try this SQL. But you can use Dynamin SQL.
SELECT TEST_NAME
,max(CASE WHEN Calendar_year = 2008 AND Calendar_quarter = 1 THEN ORDERS ELSE '' END) as Rank_Q1_2008
,max(CASE WHEN Calendar_year = 2007 AND...
April 8, 2010 at 10:44 pm
Hic, i try to buil DDL for your question
CREATE TABLE USERS(
USERKEY int,
USERNAME VARCHAR(10)
)
CREATE TABLE LANGS(
LANGKEY int,
LANGNAME VARCHAR(10)
)
CREATE TABLE TECHS(
TECHKEY int,
TECHNAME VARCHAR(10)
)
CREATE TABLE USERLANG(
USERKEY int,
LANGKEY int
)
CREATE TABLE USERTECH(
USERKEY int,
TECHKEY int
)
truncate table...
April 1, 2010 at 5:21 am
Try this SQL
order by
CASE WHEN ALPA = 'Z' THEN 0
WHEN ALPA = 'E' THEN 1
WHEN ALPA = 'B' THEN 2
WHEN ALPA = 'R' THEN 3
WHEN ALPA = 'C' THEN 4
WHEN...
April 1, 2010 at 4:21 am
Try this:
SELECT ReportQID,sum(StructuralFires) as StructuralFires
,sum(Non_StructuralFires) as Non_StructuralFires
FROM FIREReportsData
GROUP BY ReportQID
with CUBE
Result
ReportQID StructuralFires Non_StructuralFires
----------- ---------------...
March 31, 2010 at 9:24 pm
Hic, thank all for your support. I'm understand, huhu
March 31, 2010 at 7:13 pm
Yes, i think it will return blank but i can't belive why it return NULL 😀
March 31, 2010 at 6:27 am
Can you uses thia code
Select round(1.0*29/31,0)
When 29/31, SQL will use DIV (29 DIV 31) if both number are INTEGER. If you multiple 1.0 before 29, you can resolve your...
March 31, 2010 at 5:35 am
When i run this SQL
select SUBSTRING('??????????',20,1)
It return NULL but i want it return blank. I can use ISNULL but this code
select SUBSTRING('??????????',41,1)
return blank
Why not same blank or same NULL...
March 31, 2010 at 5:15 am
My string is Shift-js code
I try some case. Example:
select SUBSTRING('??????????',20,1)
select SUBSTRING('??????????',21,1)
select SUBSTRING('??????????',22,1)
select SUBSTRING('??????????',23,1)
Are NULL
What the problem???
March 31, 2010 at 4:42 am
Viewing 15 posts - 31 through 45 (of 68 total)