hi all...
how can i do a query on a list of ids without doing individual queries
for each one of them?
something like:
select id,title from content where id = 100,106,109;
of course this doesn't work... is it possible somehow?
thanks
--
MySQL General Mailing List
For list
kalin mintchev wrote:
hi all...
how can i do a query on a list of ids without doing individual queries
for each one of them?
something like:
select id,title from content where id = 100,106,109;
select id,title from content where id IN(10,20,30);
--
MySQL General Mailing List
For list
.
To: mysql@lists.mysql.com
Subject: select random ids from list
hi all...
how can i do a query on a list of ids without doing individual queries
for each one of them?
something like:
select id,title from content where id = 100,106,109;
of course this doesn't work... is it possible somehow
You could also use OR
select id, title from content where id = 100 or id =106;
Brian
From: Quentin Bennett [EMAIL PROTECTED]
To: [EMAIL PROTECTED],mysql@lists.mysql.com
Subject: RE: select random ids from list
Date: Tue, 1 Aug 2006 14:59:14 +1200
If you know the list of Ids, try
select id
select id,title from content where id IN(10,20,30);
cool thanks.. what if i want it to be random ordering like:
select id,title from content where id IN(20,10,30);
and i would like the order of the ids and the in() to be kept in the
result array. what 'order by' would i use?!
--
MySQL
kalin mintchev wrote:
select id,title from content where id IN(10,20,30);
cool thanks.. what if i want it to be random ordering like:
select id,title from content where id IN(20,10,30);
and i would like the order of the ids and the in() to be kept in the
result array. what 'order by' would