test Oracle Dev RS

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

-- SELECT * FROM users u WHERE u.WebsiteUrl IS NULL;

--SELECT * FROM users u WHERE 
--  LOWER(u.location) LIKE '%czech%' or
--  LOWER(u.location) LIKE '%česk%';

/*
SELECT u.DisplayName, p.id, p.title, p.creationdate FROM users AS u
INNER JOIN posts AS p
ON u.id=p.OwnerUserId 
WHERE  
 u.id < 100 AND
 p.title IS NOT NULL
ORDER BY u.DisplayName ASC, p.creationdate DESC;

SELECT count(1) FROM users AS u 
WHERE NOT EXISTS (
  select * FROM posts AS p
    WHERE u.id=p.OwnerUserId
                 );
                 
SELECT count(1) FROM users AS u
LEFT JOIN posts AS p
ON u.id=p.OwnerUserId 
WHERE  
 p.id IS NULL;


SELECT u.id, count(1) AS pocet FROM users AS u
LEFT JOIN posts AS p
ON u.id=p.OwnerUserId 
WHERE  
 p.id IS NULL
GROUP BY u.id
HAVING count(1) = 1;
*/

SELECT u.id,COUNT(1),[pocet] = count(1) OVER(PARTITION BY u.id) FROM users AS u
LEFT JOIN posts AS p
ON u.id=p.OwnerUserId 
GROUP BY u.id
HAVING count(1)=0
;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results