query sql code example

Example 1: css in sql query

SELECT  'test1' AS [@class]
    , ( SELECT  'test2' as [@class]
        , (SELECT 'Name' FOR XML PATH(''))
        FOR XML PATH('td'), type)
    ,(SELECT  'test3' as [@class]
        , (SELECT 'Value' FOR XML PATH(''))
        FOR XML PATH('td'), type) 
FOR XML PATH('tr'), type

Example 2: sql select syntax

select [all/distinct] <COL1>, <COL2>, <COL3>
from <TABLE_NAME>
[join <JOIN_CONDITION>]
[where <CONDITION>]
[group by <COLUMN_NAME>]
[having <SEARCH_CONDITION>]
[order by <SORT_SPECIFICATION>]


/*
Specifically for SQL -> Oracle

LEGEND: 
[...]   :   optional entries
<...>   :   your specific entry
*/

Example 3: how select from db

SELECT columname FROM tablename

Example 4: sql queries

sql queries

Example 5: sql query

$meta_query_args = array(
    'relation' => 'OR', // Optional, defaults to "AND"
    array(
        'key'     => '_my_custom_key',
        'value'   => 'Value I am looking for',
        'compare' => '='
    ),
    array(
        'relation' => 'AND',
        array(
            'key'     => '_my_custom_key_2',
            'value'   => 'Value I am looking for 2',
            'compare' => '='
        ),
        array(
            'key'     => '_my_custom_key_3',
            'value'   => 'Value I am looking for 3',
            'compare' => '='
        )
    )
);
$meta_query = new WP_Meta_Query( $meta_query_args );

Tags:

Html Example