This is a simple SELECT statement:

SELECT id 
FROM Table 
WHERE nr=3D123 
AND       id = 3D456

this gives you probably one record, or you could use OR:

SELECT id 
FROM Table 
WHERE nr=3D123 
OR       id = 3D456

this gives you all records with nr 3D123 OR id 3D456

//
Jonny


> -----Ursprungligt meddelande-----
> Från: Spielberg Micha [SMTP:[EMAIL PROTECTED]]
> Skickat:      den 22 maj 2002 07:46
> Till: [EMAIL PROTECTED]
> Ämne: Subselect or other way?
> 
> Hi,
> 
> i have a table like this:
> 
> Fields: id,nr
> I want now a query like this:
>  SELECT id FROM Table WHERE nr=3D123 and (SELECT id FROM Table
> WHERE nr=3D456).
> 
> Must i do this with a temp Table or ist there any other way to do this
> with Joins?
> 
> I hope someone can help me..
> 
> regards Micha
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to