SQL Select change column to row

How to change column from table to row?




Example data from table1

id name lastname month1 month2 month3
1 name1 lastname1 300 400 500
2 name2 lastname2 10 20 30


Code :

SELECT id,name,lastname,amount,month
FROM (
SELECT id,name,lastname, month1 as amount, '1' as month FROM table1 as t1
UNION ALL
SELECT id,name,lastname,month2 as amount, '2' as month FROM table1 as t2
UNION ALL
SELECT id,name,lastname,month3 as amount, '3' as month FROM table1 as t3
)


Result :
id name lastname amount month
1 name1 lastname1 300 1
1 name1 lastname1 400 2
1 name1 lastname1 500 3
2 name2 lastname2 10 1
2 name2 lastname2 20 2
2 name2 lastname2 30 3

What is QlikView Product?

What is QlikView? Is it good for Business Intelligence?




I fail in love with QlikView immediately after I have tried to used it for the first time, If you are a developer of BI tools, You may know or do not know about this product, but let's me tell you some thing how is QlikView cool?

WHAT IS IT?
QlinkView is the one product (from Sweden) to create Business Intelligent concept to generate report, the dimension of report that you want to see and process, in basically of general report you will see only 2 dimension of data but if you use BI concept, you can answer and question of your boss when he/her would like to know some information of data in different view in 2 minutes.

HOW IS GOOD in QlikView ?
- Very simple and easy to create report
- Support every database type by use connecting driver
- Fast and Smooth
- Write in memory concept that why it make QlikView process report very fast
- You can create What's if as you want
- Available import google map to create bubble

You can download and use it by link before, it's free and can use any feature like license product but the different thing is you can not run report in any other computer, except the computer you have installed QlinkView
http://www.qlik.com/

Jquery DatePicker Show Full Month Name and Year





Result




Jquery Code


$("#dateStart").datepicker({

changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: 'MM yy',
onClose: function(dateText, inst)
{
    var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
    var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
    $(this).datepicker('setDate', new Date(year, month, 1));
}

});

Godaddy I am angry you! T_T

WHAT HAPPEN WITH GODADDY?


Somebody can help me? please I spent almost one week to fixed the problem how to connect the database.

Let's me tell you about bad mood with godaddy.com, Yes I am the one customer of them for many years ago, I loved godaddy features, They have many features for you to selection to matching with your business and needs, It was very simple and easy to config.

I buy many domain name from godaddy and I also paid for hosting because it was stable and simple for me to config but now every things seem harder then before.

1. I do not understand why godaddy not set www to be default to transfer files ( After I transfer files to godaddy I could not laugh my website immediately)

2. After I created database and connected to database by use PHP script, until now I still do not know what is wrong? The script said I could connect to server but database could not, I have checked username, password, database name, every things look find but T_T why I still cannot connect to my database.

This is a very simple script to connect database

$hostname = "localhost";
$username = "username";
$password = "password";
$dbname = "databasename";

mysql_connect($hostname,$username, $password) or die("Can not connect to server");
mysql_select_db($dbname);

mysql_query("SELECT * FROM mytable");

BUT you do not allow me to get in WHY? I'm sad

3.Godaddy help support is not convenient, They put all solutions in blog and the customer have to search there but some of my problem were different from them and I have to spent a lot of time to searching, They have only calling number, before I just open my problem and they solved the problem for me very fast but now so different.

4.I'm not happy for godaddy help center, it was not help and one more thing I just wonder why godaddy seem slow more then before, I spent a half of day to transfer my files (only 22.MB) to server Or it because I living far away from you? Yes you live in USA for me I live in Thailand or this is the reason why you do not care about me? T_T

5.And for user interface to set up, it seem too slow when I click on some link and page, I had count how much time it take 1 2 3 4 5 6 7 8 9....20 some page almost to 30 OH! my god, I would like to change to use an other hosting.

6.Any one have bad experience like me with godaddy?

SORRY to talk about you godaddy but seem like you have developing in wrong way...the way you were before was nice that why I return to use your products.

I hope you will help me and improve your products, This is the way I can connect you because you close every way for customer to contract you in direct.

Reporting Service Configuration to Sending Mail


The photo is not match about the story I will talking about today, I knew that but I just want all of you to be happy and smile ^_^ and I likes her hips even I am a girl and straight.

OKEY! today I would like present how to configuration mail on SQL Reporting Service to sending mail to any concerns.

STEP-1
Go to "SQL Server Reporting Service Configuration Manager"




STEP-2
You will the popup as image below, This details in window it for configuration of SQL Reporting Service Only






STEP-3Then you have to fill mail server detail as image below






What is TM1 Cognos? What is good and bad side?



TM1 is the one product of IBM, The full name of TM1 is Table Manager One, Yes the concept of TM1 is keep all data on memory, Build cube, Build dimension that very easy and it create for supporting financial and budgeting planning.

For the concept to keep all data in memory, that helpful, you do not need to process cube if you want generate any report, very simple and fast then other product, They said ^_^.

There are many ways to enter to TM1 for many reason
1.TM1 Architect 
This work space is comfortable for programming, and some super user to get inside for key in data, budget, you can create cube, dimension, create formula, codding in this product.

2.TM1 Perspective
It still look the same like TM1 Architect but the only one is different it because you can export your job from here to excel or slice your job to excel with formula then you can work on excel, if you selected to slice that mean every formula will export to excel also, whatever you have change from excel, it'll make effect to TM1 Architect automatically, So why IBM have to create this product?.

3.TM1 Application
It's a web application and it the way to get inside to project. You can create work flow on this product but you can not create cube or build any dimension on here, user also can key in data on this space.

4.TM1 Web
I'm still not sure why they need to separate this section from TM1 application product because every thing seem like the same, but the different one is you can not create work flow on here, that it's!?

5.TM1 Insight
Yes if you want to work in off line, you have to install TM1 insight on your computer but that not helpful, U can not sick your job to server after you have done automatic, it need special way to do, every thing feel the same TM1 application, but you just can create or import cube and dimension from here then I still not get why IBM have to create many window to inside work space that too trouble.


Let's see compare between TM1 and SQL Server Analysis Service
List TM1 SQL server analysis services
Brand IBM Microsoft
Build Cube Yes Yes
Process Cube No Yes
Make data relation table Yes Yes
User Friendly Poor Nice
Programmer Friendly Poor Nice
In memory Yes No
Fast Depend on data Depend on data
Database No SQL Server
Work Flow Yes No
Off Line Mode Yes No
Recouse Height Speed Heidht Speed

SSIS Parameters in Different Type of Data in Package

How can I image that parameters in SSIS that quite different when you have to use it in different type of data flow. Yes I know that at first we have to create parameters in same level but when you have to select data by use different type of database you have to change the syntax for query, OKEY! let's see what is different.

Set Parameter for Execute SQL Task Step 1
STEP-1
You have to create parameters as below by click on menu  SSIS -> "Variables"






STEP-2
Define parameters as you want for example, year, month etc..





STEP-3
After you created and define all parameters as you want you have to set parameter for "Execute SQL Task", you have to set type of parameter as your data config on table of database


STEP-4
Then click on query of Task and you have to replace the value of parameter by use =? instead


STEP-5
But if you have to put parameter on "ADO Net Source" object, you have to replace it by =@parameter_name



Set Parameter for Execute SQL Task Step 2
STEP-6
Any if you have to use "Execute SQL Task" in same package and need to set parameter, you have to add parameter in that task again


STEP-7
After you set parameter on this step, you have to replace parameter by use "=?" in "Execute SQL Task" it the same as step 1


STEP-8
To use parameter for query on OLE DB you have to click on "Parameters" button on the right page of window popup


STEP-9
And now you have to replace parameter on OLE DB for query data from SQL Server as
"=?"


STEP-10
It's perfect your job package will look like this image, click on "Start" for running package





Notice :
Define parameter for a package you have to set it just one time but for use parameter in different type of object, you have to replace in different symbol.