Tuesday, February 9, 2016

PostrSQL TRIM- Remove blanks

Use TRIM function for (clear white spaces) remove leading and trailing blanks from column of every row in a table

Example

UPDATE table SET column = TRIM(column);

Or

UPDATE table SET column = TRIM(both ' " " ' from column);

Monday, February 8, 2016

Thursday, February 4, 2016

DataTables JQuery: DataTables warning: table id=example - Requested unknown parameter '3' for row 0. For more information about this error, please see http://datatables.net/tn/4



DataTables warning: table id=example - Requested unknown parameter '3' for row 0. For more information about this error, please see http://datatables.net/tn/4
 
This simple solution works for my problem.

<tr>
    <th>Field 1</th>
    <%
        if (showField) {
    %>   
    <th>Field 2</th>
    <th>Field 3</th>
    <%
        } else {
    %>

    <td colspan="2">
        Information, error o warning message!!
    </td>
    <td hidden="true"></td>
</tr>

SQL Server SELECT CASE and convert in VARCHAR


numberValue  is an number

SELECT CASE numberValue 
                        WHEN 1 THEN 'State 1'
                        WHEN 2 THEN 'State 2'
                        WHEN 3 THEN 'State 3'
                        ELSE CAST (numberValue AS VARCHAR(50))



SQL Server SELECT DISTINCT and TOP


Use first DISTINCT netx use TOP and number of the limit

Example:

SELECT DISTINCT TOP 100 FROM Table WHERE condition = condition