Showing posts with label normally. Show all posts
Showing posts with label normally. Show all posts

Friday, March 23, 2012

How to make a random order query ?

If we use: select * from .... , normally, it will return an ordered result ( may be order by ID ), but how can we make an random order select statement. It mean every time we run the query, the result will be different from the other ?Hi,

FYI:http://www.datawebcontrols.com/faqs/Data/ReturningDataInRandomOrder.shtml

Regards,

Monday, March 12, 2012

how to list the records of a select

Hi world,
Normally we receive the results of a query in several or thousands of rows.
Select * From Clients
--------
Row1. Client1
Row2. Client2
...
Which is the the way to have everything on the same row separated by commas?
Row1. Client1, Client2...

thx
David

DECLARE @.MyStr varchar(8000)

SELECT @.MyStr = ISNULL(@.MyStr, '') + Column1+ ',' + Column2+ ','
FROM Anal
where UserName is not null
print @.MyStr
Thanks,
Ram