document.write('<link rel="stylesheet" href="http://gist.github.com/stylesheets/gist/embed.css"/>')





document.write('<div id=\"gist-239738\" class=\"gist\">\n  \n  \n    \n            \n\n      <div class=\"gist-file\">\n        <div class=\"gist-data gist-syntax\">\n          \n          \n          \n            <div class=\"gist-highlight\"><pre><div class=\"line\" id=\"LC1\">-- define our data table<\/div><div class=\"line\" id=\"LC2\">WITH data( num )<\/div><div class=\"line\" id=\"LC3\">AS<\/div><div class=\"line\" id=\"LC4\">(<\/div><div class=\"line\" id=\"LC5\">	-- our value range in a single query<\/div><div class=\"line\" id=\"LC6\">	SELECT 0 AS \'num\'<\/div><div class=\"line\" id=\"LC7\">	UNION<\/div><div class=\"line\" id=\"LC8\">	SELECT 512 AS \'num\'<\/div><div class=\"line\" id=\"LC9\">	UNION<\/div><div class=\"line\" id=\"LC10\">	SELECT 1024 AS \'num\'<\/div><div class=\"line\" id=\"LC11\">	UNION<\/div><div class=\"line\" id=\"LC12\">	SELECT 1536 AS \'num\'<\/div><div class=\"line\" id=\"LC13\">	UNION<\/div><div class=\"line\" id=\"LC14\">	SELECT 2048 AS \'num\'<\/div><div class=\"line\" id=\"LC15\">)<\/div><div class=\"line\" id=\"LC16\">SELECT TOP 1 num FROM data <\/div><div class=\"line\" id=\"LC17\">ORDER BY NEWID()<\/div><\/pre><\/div>\n        \n        <\/div>\n\n        <div class=\"gist-meta\">\n          <a href=\"http://gist.github.com/raw/239738/9e724fc7704bdc1f6808a45b4756453da4bfc5f4/tSQL%20:%20Select%20random%20value%20using%20CTE\" style=\"float:right;\">view raw<\/a>\n          <a href=\"http://gist.github.com/239738#file_t_sql : select random value using cte\" style=\"float:right;margin-right:10px;color:#666\">tSQL : Select random value using CTE<\/a>\n          <a href=\"http://gist.github.com/239738\">This Gist<\/a> brought to you by <a href=\"http://github.com\">GitHub<\/a>.\n        <\/div>\n      <\/div>\n    \n  \n<\/div>\n')
