[PHP-DB] SQL question!

2004-05-03 Thread Bruno Braga
Hey. I have these tables. Users ( id,name,etc ) Coments : ( id , comment ) How do I do this kind of query: I thought in one thing like this but I cant figure it out. Example: Select * from users order by id desc in (select count (id) from comments) Expected result: List

Re: [PHP-DB] SQL question!

2004-05-03 Thread Larry E . Ullman
I have these tables. Users ( id,name,etc ) Coments : ( id , comment ) How do I do this kind of query: I thought in one thing like this but I cant figure it out. Example: Select * from users order by id desc in (select count (id) from comments) Expected result: List of users: * User1 See comments

Re: [PHP-DB] SQL question

2003-12-11 Thread Muhammed Mamedov
_name%" part_of_name appears at the begining M.Mamedov - Original Message - From: "Muhammed Mamedov" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 11, 2003 2:00 PM Subject: Re: [PHP-DB] SQL question > It should be as follows

RE: [PHP-DB] SQL question

2003-12-11 Thread brettking
try SELECT * FROM x_table WHERE name LIKE "%part_of_name%" -Original Message- From: Constantin Brinzoi [mailto:[EMAIL PROTECTED] Sent: 11 December 2003 11:52 To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL question I know it is possible to search a database like this:

RE: [PHP-DB] SQL question

2003-12-11 Thread Ford, Mike [LSS]
On 11 December 2003 11:52, Constantin Brinzoi wrote: > I know it is possible to search a database like this: > > SELECT * FROM x_table WHERE name="%part_of_name%" > > but I don't know for sure the correct command. > > Could you tell me the right syntax? SELECT * FROM x_table WHE

Re: [PHP-DB] SQL question

2003-12-11 Thread Muhammed Mamedov
It should be as follows: SELECT * FROM x_table WHERE name Like = "%part_of_name%" Hope this helps, M.Mamedov - Original Message - From: "Constantin Brinzoi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 11, 2003 1:51 PM Subject: [PH

[PHP-DB] SQL question

2003-12-11 Thread Constantin Brinzoi
I know it is possible to search a database like this: SELECT * FROM x_table WHERE name="%part_of_name%" but I don't know for sure the correct command. Could you tell me the right syntax? TIA Aurel. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.p

[PHP-DB] SQL question!

2002-06-27 Thread Bruno Gimenes Pereti
Hi, I need a sql query to join multiple lines into only one line. Ok, I wouldn´t understand this question so I´ll give an example (I´m doing it on mysql but I need it to mssql). Supose I have 3 tables: mysql> select * from test1; ++---+ | id| nome | ++---+ | 1| Bruno

RE: [PHP-DB] SQL Question

2002-03-13 Thread Gurhan Ozen
you can do it by using distinct function .. Do: SELECT DISTINCT(city) FROM addresses; Gurhan -Original Message- From: Kevin Diffily [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 2:05 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL Question Hello, I have a simple SQL

RE: [PHP-DB] SQL Question

2002-03-13 Thread Rick Emery
SELECT DISTINCT city FROM addresses; -Original Message- From: Kevin Diffily [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 1:05 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] SQL Question Hello, I have a simple SQL Question. I would like to take the column city in database

[PHP-DB] SQL Question

2002-03-13 Thread Kevin Diffily
Hello, I have a simple SQL Question. I would like to take the column city in database addresses and find out which cities are available in it. In other words if the following values are in there: city El Paso Burlington New York New York El Paso Burlington I would like it to return El Paso