SELECT name
FROM
(
SELECT Кто AS name
FROM Table
WHERE Кому='Паша'
UNION
SELECT Кому
FROM Table
WHERE Кто='Паша'
) AS t1
GROUP BY name
....
if ($(".star-rating").children().length==0)
{
$('div.star-rating-wrap').append('<div class="empty"></div>');
}
...
SELECT user1, user2, cnt
FROM
(
SELECT t3.name AS user1,
t4.name AS user2,
COUNT(*) AS cnt
FROM users_groups AS t1
INNER JOIN users_groups AS t2
ON t1.user_id<t2.user_id
AND t1.group_id=t2.group_id
LEFT JOIN users AS t3
ON t1.user_id=t3.id
LEFT JOIN users AS t4
ON t2.user_id=t4.id
GROUP BY t1.user_id, t2.user_id, t3.name, t4.name
) AS t1
ORDER BY cnt DESC
LIMIT 0,1
SELECT Content_id
FROM table
WHERE t.Tag_id = 'aa'
EXCEPT
SELECT Content_id
FROM table
WHERE t.Tag_id = 'bb'
SELECT Content_id
FROM table AS t
WHERE t.Tag_id = 'aa'
AND t.Tag_id NOT IN
(
SELECT Content_id
FROM table
WHERE t.Tag_id = 'bb'
)
SELECT *
FROM questions
WHERE userName='YourOwnSenpaie'
/*
* - означает, что выбираем все поля (имя, фамилию, ник, e-mail и т д)
questions - название таблицы, хранящей вопросы
WHERE userName='YourOwnSenpaie' - условие, означающее, что выбирать нужно только ваши вопросы, а не чужие
*/
var form = $( "#myform" );
form.validate();
$( "button" ).click(function() {
$("input.valid").removeClass("valid");
$("label.need-class").addClass("valid");
});
<globalization uiCulture="ru" culture="ru-RU" />