2013年11月15日 星期五

ms sql subquery

昨天一個朋友問我一個sql子查詢相關的問題,好險這幾年下來也累積了不少sql語法的經驗,這邊順便將結果記錄下來

一個table中有 a_uid和b_uid兩個欄位,如何將有不同b_uid的a_uid抓出來

資料
 執行結果

 完整語法如下

select * from (select COUNT(distinct(b_uid)) as num,a_uid from tbl_test3 where a_uid in(select a_uid from tbl_test3) group by a_uid) as a where a.num>1


2013年11月6日 星期三

get like count using fql

https://developers.facebook.com/tools/explorer/?fql=select%20caption%2Clike_info%20from%20photo%20where%20owner%3D701888397


select caption,like_info from photo where owner=701888397

2013年11月5日 星期二

c# convert utf8 to big5

public string ConvertBig5(string strUtf)
    {
        System.Text.Encoding utf81 = System.Text.Encoding.GetEncoding("utf-8");
        System.Text.Encoding big51 = System.Text.Encoding.GetEncoding("big5");
        Response.ContentEncoding = big51;
        byte[] strUtf81 = utf81.GetBytes(strUtf.Trim());
        byte[] strBig51 = System.Text.Encoding.Convert(utf81, big51, strUtf81);

        char[] big5Chars1 = new char[big51.GetCharCount(strBig51, 0, strBig51.Length)];
        big51.GetChars(strBig51, 0, strBig51.Length, big5Chars1, 0);
        string tempString1 = new string(big5Chars1);
        return tempString1;
    }

2013年11月1日 星期五

cuteeditor javascript api


http://www.cutesoft.net/developer+guide/index.htm#page=JavaScript-API.htm