Odd select question

2009-10-12 Thread Bruce Ferrell
I seem to recall a SQL select syntax along these lines: SELECT col1, col2 WHERE col1 IN (set) Is this or similar syntax in MySQL or is my dotage coming upon me Thanks in advance, Bruce -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: Odd select question

2009-10-12 Thread Claudio Nanni
There is! But I would definitely check the online doc for further and more complete info. Cheers! Claudio On Oct 12, 2009 9:47 PM, Bruce Ferrell bferr...@baywinds.org wrote: I seem to recall a SQL select syntax along these lines: SELECT col1, col2 WHERE col1 IN (set) Is this or similar syntax

Re: Odd select question

2009-10-12 Thread Jim Lyons
that's legal where set is a comma-delimited list of items of the same datatype as col1 On Mon, Oct 12, 2009 at 2:41 PM, Bruce Ferrell bferr...@baywinds.orgwrote: I seem to recall a SQL select syntax along these lines: SELECT col1, col2 WHERE col1 IN (set) Is this or similar syntax in MySQL

update select question

2008-04-15 Thread Chris W
I have the following query... SELECT c.NLCID, n.publishdate FROM newsletter n JOIN newslettersection s using (NLID) JOIN newslettercontent c using(NLCID) WHERE contenttype = 1 AND n.publishdate AND c.`timestamp` = '-00-00 00:00:00' I want to run an update on newslettercontent and set its

Re: update select question

2008-04-15 Thread Sebastian Mendel
Chris W schrieb: I have the following query... SELECT c.NLCID, n.publishdate FROM newsletter n JOIN newslettersection s using (NLID) JOIN newslettercontent c using(NLCID) WHERE contenttype = 1 AND n.publishdate AND c.`timestamp` = '-00-00 00:00:00' I want to run an update on

Re: update select question

2008-04-15 Thread Ananda Kumar
update newslettercontent c set c.timestamp= (select n.publishdate from newsletter n where n.NLCID= c.NLCID); This should work. On 4/16/08, Chris W [EMAIL PROTECTED] wrote: I have the following query... SELECT c.NLCID, n.publishdate FROM newsletter n JOIN newslettersection s using (NLID)

A sql/select question.

2008-02-18 Thread King C. Kwok
table users iduser_iduser_name 1 M11 Shirley 2 M12 Bruce 3 M13 Fred 4 M14 Albert 5 M15 Elizabeth 6 T11 Helen 7 T12 Tracy 8 T13 Charles 9 T14 Jack 10 T15 Ann table

Re: A sql/select question.

2008-02-18 Thread Rob Wultsch
2008/2/18 King C. Kwok [EMAIL PROTECTED]: table users iduser_iduser_name 1 M11 Shirley 2 M12 Bruce 3 M13 Fred 4 M14 Albert 5 M15 Elizabeth 6 T11 Helen 7 T12 Tracy 8 T13 Charles

Re: A sql/select question.

2008-02-18 Thread King C. Kwok
Hi Rob, That is just what I need. I can't use 'join' very well yet. Thank you very much. -- King Kwok -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Select question

2007-10-25 Thread Matthew Stuart
I've got this statement to select the last two entries in my db: SELECT top 2 * FROM Content ORDER BY ContentID desc and it works fine because it selects the last two items entered into the db. However, I only want to be able to select item 2 rather than both 1 and 2. How do I do that?

Re: Select question

2007-10-25 Thread Ralf Hüsing
Matthew Stuart schrieb: I've got this statement to select the last two entries in my db: SELECT top 2 * FROM Content ORDER BY ContentID desc and it works fine because it selects the last two items entered into the db. However, I only want to be able to select item 2 rather than both 1

RE: Select question

2007-10-25 Thread Jerry Schwartz
: Thursday, October 25, 2007 6:55 AM To: MySQL email support Subject: Select question I've got this statement to select the last two entries in my db: SELECT top 2 * FROM Content ORDER BY ContentID desc and it works fine because it selects the last two items entered into the db. However, I

Select question

2007-05-17 Thread Erich C. Beyrent
I have three tables, all of which have a 'name' column. If I do: select table1.*, table2.*, table3.* from I'll end up with a result set that has three 'name' fields, but no way to distinguish which table the field belongs to. I know I can select individual columns like: select

Re: Select question

2007-05-17 Thread Peter Brawley
Erich, Is there a way to set a prefix for each table so that the results come out like tablename.column? Use a scripting or application language to automate parameterise query generation. SQL is just a partial computing language. PB - Erich C. Beyrent wrote: I have three tables, all

Re: varchar(5) and select question

2006-07-04 Thread Pooly
Hi, 2006/6/29, Joerg Bruehe [EMAIL PROTECTED]: Hi Pooly, all, Pooly wrote: Hi, I stumbled on one issue yesterday which took me some time to figure out. the table is : create table tt ( PCname varchar(5) not null default ''); insert into tt values ('Centaure'); So, by mistake I

varchar(5) and select question

2006-06-29 Thread Pooly
Hi, I stumbled on one issue yesterday which took me some time to figure out. the table is : create table tt ( PCname varchar(5) not null default ''); insert into tt values ('Centaure'); So, by mistake I inserted names which were too long for the field, but then I tried to do queries on this

Re: varchar(5) and select question

2006-06-29 Thread Chris White
On Thursday 29 June 2006 08:18 am, Pooly wrote: Hi, I stumbled on one issue yesterday which took me some time to figure out. the table is : create table tt ( PCname varchar(5) not null default ''); insert into tt values ('Centaure'); (5) indicates a display width. So, by mistake I

Re: varchar(5) and select question

2006-06-29 Thread Joerg Bruehe
Hi Pooly, all, Pooly wrote: Hi, I stumbled on one issue yesterday which took me some time to figure out. the table is : create table tt ( PCname varchar(5) not null default ''); insert into tt values ('Centaure'); So, by mistake I inserted names which were too long for the field, but then I

Re: SELECT question - query for records over a series of dates

2005-08-17 Thread Dan Tappin
I think you might be one to something here... is there such a thing as a while loop in MySQL? i.e. can I fill a table with data via a MySQL query? I guess I could do it via PHP... I could create a temp table with one column of dates for the range I am looking for and then LEFT JOIN my

Re: SELECT question - query for records over a series of dates

2005-08-17 Thread Michael Stassen
Dan Tappin wrote: I think you might be one to something here... is there such a thing as a while loop in MySQL? i.e. can I fill a table with data via a MySQL query? I guess I could do it via PHP... I could create a temp table with one column of dates for the range I am looking for and

SELECT question - query for records over a series of dates

2005-08-16 Thread Dan Tappin
I have a table full of data... a log of sorts. Each row has a timestamp. I want to generate some reports based on this data. For example I want a COUNT(*) of the rows for each day for the past week, 30 days, 12 months etc. I have no problem generating the query but I am stuck on a

Re: SELECT question - query for records over a series of dates

2005-08-16 Thread Daniel Kasak
Dan Tappin wrote: I have a table full of data... a log of sorts. Each row has a timestamp. I want to generate some reports based on this data. For example I want a COUNT(*) of the rows for each day for the past week, 30 days, 12 months etc. I have no problem generating the query but I

Re: SELECT question - query for records over a series of dates

2005-08-16 Thread Michael Stassen
Dan Tappin wrote: I have a table full of data... a log of sorts. Each row has a timestamp. I want to generate some reports based on this data. For example I want a COUNT(*) of the rows for each day for the past week, 30 days, 12 months etc. I have no problem generating the query but I am

Re: update and select question

2005-04-27 Thread mfatene
Hi, Look at select ... for update here : http://dev.mysql.com/doc/mysql/en/innodb-locking-reads.html Mathias Selon $B2 9bJv(B [EMAIL PROTECTED]: i use this mail first . i have a problem in under sql program: UPDATE NGLDENHDT SET EDT_HUK_FLG = :EDT_HUK_FLG WHERE

Re: update and select question

2005-04-27 Thread Philippe Poelvoorde
$B2+9bJv(B wrote: (B i use this mail first . (B (B i have a problem in under sql program: (B (B (B UPDATE (B NGLDENHDT (B SET (B EDT_HUK_FLG = :EDT_HUK_FLG (B WHERE (B KAI_CDE = :KAI_CDE (B AND EDT_NUM = (SELECT MAX(EDT_NUM) (BFROM

Re: update and select question

2005-04-27 Thread Jigal van Hemert
From: "$B2+9bJv(B" (B (B UPDATE (B NGLDENHDT (B SET (B EDT_HUK_FLG = :EDT_HUK_FLG (B WHERE (B KAI_CDE = :KAI_CDE (B AND EDT_NUM = (SELECT MAX(EDT_NUM) (BFROM NGLDENHDT (BWHERE KAI_CDE = :KAI_CDE_T1 (B

update and select question

2005-04-26 Thread 黄高峰
i use this mail first . (B (Bi have a problem in under sql program: (B (B (BUPDATE (BNGLDENHDT (BSET (BEDT_HUK_FLG = :EDT_HUK_FLG (BWHERE (B KAI_CDE = :KAI_CDE (B AND EDT_NUM = (SELECT MAX(EDT_NUM) (B FROM NGLDENHDT (B

update and select question

2005-04-26 Thread 黄高峰
(Bi use this mail first . (B (Bi have a problem in under sql program: (B (B (BUPDATE (BNGLDENHDT (BSET (BEDT_HUK_FLG = :EDT_HUK_FLG (BWHERE (B KAI_CDE = :KAI_CDE (B AND EDT_NUM = (SELECT MAX(EDT_NUM) (B FROM NGLDENHDT (B

FW: update and select question

2005-04-26 Thread J.R. Bullington
: Tuesday, April 26, 2005 11:26 PM (BTo: mysql@lists.mysql.com (BSubject: update and select question (B (B (Bi use this mail first . (B (Bi have a problem in under sql program: (B (B (BUPDATE (BNGLDENHDT (BSET (BEDT_HUK_FLG = :EDT_HUK_FLG (BWHERE (B KAI_CDE = :KAI_CDE (B

SELECT question

2004-12-29 Thread Richard Reina
I know to most of you this will seem like a mundane question, but I was hoping someone can tell me how to select the last record in a table that meets certain criteria. Like to see who hosted the last party in CHicago. SELECT host FROM PARTY WHERE city=chicago; PARTY ID |host | city | st |

RE: SELECT question

2004-12-29 Thread Jay Blanchard
[snip] I know to most of you this will seem like a mundane question, but I was hoping someone can tell me how to select the last record in a table that meets certain criteria. Like to see who hosted the last party in CHicago. SELECT host FROM PARTY WHERE city=chicago; PARTY ID |host | city |

Re: SELECT question

2004-12-29 Thread DreamWerx
ORDER BY host DESC LIMIT 1 On Wed, 29 Dec 2004 14:18:02 -0800 (PST), Richard Reina [EMAIL PROTECTED] wrote: I know to most of you this will seem like a mundane question, but I was hoping someone can tell me how to select the last record in a table that meets certain criteria. Like to see who

Select Question

2004-10-05 Thread Feghhi, Jalil
Is there a way to convert the following result set: id f2 --- --- 1 b 1 c to: id f2 -- -- 1 b,c Using a select or any other functions? Basically, I want to put f2 fields together when ids are the

Re: Select Question

2004-10-05 Thread Michael Stassen
If you have mysql 4.1, you can use GROUP_CONCAT(). SELECT id, GROUP_CONCAT(f2) FROM yourtable GROUP BY id; See the manual for details http://dev.mysql.com/doc/mysql/en/GROUP-BY-Functions.html. Michael Feghhi, Jalil wrote: Is there a way to convert the following result set: id f2

Re: Select Question

2004-10-05 Thread SGreen
Check out the GROUP_CONCAT() function, see if this help: http://dev.mysql.com/doc/mysql/en/GROUP-BY-Functions.html Shawn Green Database Administrator Unimin Corporation - Spruce Pine Feghhi, Jalil [EMAIL PROTECTED] wrote on 10/05/2004 11:20:21 AM: Is there a way to convert the following

Re: Select Question

2004-10-05 Thread Giulio
If your MySQL version is 4.1 or later, you could try GROUP_CONCAT the query should be ( not tested ): select id,GROUP_CONCAT(f2) from tablename group by id regards, Giulio Il giorno 05/ott/04, alle 17:20, Feghhi, Jalil ha scritto: Is there a way to convert the following result set: id

Re: SELECT question

2004-09-21 Thread Andre Matos
Hi Roger, I took the suggestion from Brad Eacker and use BETWEEN and now works without problem. However, I decided to do a couple more tests and what I found was that the problem occurs on MySQL version 4.0.18-standard using InnoDB on Linux but does not occur on Mac OS X using the same MySQL

SELECT question

2004-09-20 Thread Andre Matos
Hi List, I am performing a SELECT and I am getting 0 rows when I run the SELECT direct in the MySQL database and getting 1 when I run using PHP. This is my select: SELECT * FROM scan WHERE TimePointID = 3 AND ScanQCResult = 'n' AND (ScanStatusID 90 OR ScanStatusID 98); I realized latter

Re: SELECT question

2004-09-20 Thread Roger Baklund
* Andre Matos I am performing a SELECT and I am getting 0 rows when I run the SELECT direct in the MySQL database and getting 1 when I run using PHP. This is my select: SELECT * FROM scan WHERE TimePointID = 3 AND ScanQCResult = 'n' AND (ScanStatusID 90 OR ScanStatusID 98); Looks ok. I

Re: SELECT question

2004-09-20 Thread beacker
Andre Matos writes: SELECT * FROM scan WHERE TimePointID = 3 AND ScanQCResult = 'n' AND (ScanStatusID 90 OR ScanStatusID 98); I realized latter analyzing this select that I made a mistake using OR at this point: (ScanStatusID 90 OR ScanStatusID 98), it should be AND. The second rendition

basic select question...

2004-07-05 Thread bruce
hi... a basic select question/issue that should work mysql select * from instructorTBL; ++--++-+---++ | name | universityID | deptID | email | phone | ID

Re: basic select question...

2004-07-05 Thread Wesley Furgiuele
Possibly because, if there is no typo, your table's name field is: dr. smith1 (note the period after dr) But your query is looking for dr smith1 Does that fix it for you? Wes On Jul 5, 2004, at 4:18 PM, bruce wrote: hi... a basic select question/issue that should work mysql select * from

INSERT ... SELECT question

2004-03-29 Thread Eric J. Janus
I have a table with just about 100 columns, and I would like to duplicate a row exactly, except for one column, which is the AUTO_INCREMENT column. Using 'INSERT INTO tbl_name SELECT * FROM tbl_name WHERE id_col = 1' doesn't work, because it produces the following error: 'ERROR 1062: Duplicate

RE: INSERT ... SELECT question

2004-03-29 Thread Matt Chatterley
, col2, col3: INSERT INTO table (col2, col3) SELECT col2, col3 FROM table2 WHERE id_col=1; Regards, Matt -Original Message- From: Eric J. Janus [mailto:[EMAIL PROTECTED] Sent: 29 March 2004 19:37 To: MySQL Subject: INSERT ... SELECT question I have a table with just about 100 columns

RE: INSERT ... SELECT question

2004-03-29 Thread Eric J. Janus
was hoping that MySQL had something built in to make this easier. Thanks, Eric -Original Message- From: Matt Chatterley [mailto:[EMAIL PROTECTED] Sent: Monday, March 29, 2004 2:11 PM To: 'Eric J. Janus'; 'MySQL' Subject: RE: INSERT ... SELECT question Importance: Low Can you

RE: INSERT ... SELECT question

2004-03-29 Thread Matt Chatterley
: INSERT ... SELECT question There is only 1 table. I want to replicate a record in a table except the AUTO_INCREMENT column. Your solution would work, but I'd prefer to not have to maintain a list of columns in the application. Worst case I'll have the application generate the query based

RE: INSERT ... SELECT question

2004-03-29 Thread Eric J. Janus
, March 29, 2004 2:25 PM To: 'Eric J. Janus'; 'MySQL' Subject: RE: INSERT ... SELECT question Importance: Low Oh, if only there were views!! That would make this easy. Maybe soon (*please*). :) Another approach (more cumbersome) might be to insert the rows you need to duplicate into a temporary

RE: INSERT ... SELECT question

2004-03-29 Thread Henrik Schröder
an appropriate where-clause to the above statement. /Henrik -Original Message- From: Eric J. Janus [mailto:[EMAIL PROTECTED] Sent: den 29 mars 2004 21:28 To: Matt Chatterley; 'MySQL' Subject: RE: INSERT ... SELECT question Views would be nice. :) That idea sounds like it would work

RE: INSERT ... SELECT question

2004-03-29 Thread Eric J. Janus
the application everytime I change the table, which I don't always want to do. -Original Message- From: Henrik Schröder [mailto:[EMAIL PROTECTED] Sent: Monday, March 29, 2004 3:07 PM To: 'Eric J. Janus'; 'MySQL' Subject: RE: INSERT ... SELECT question Importance: Low

Re: another insert select question

2003-11-05 Thread Egor Egorov
Jason Joines [EMAIL PROTECTED] wrote: Table employees: | idnumber | email | phone | address | Table webusers: - | idnumber | userid | website | -

Re: another insert select question

2003-11-05 Thread Jason Joines
Egor Egorov wrote: Jason Joines [EMAIL PROTECTED] wrote: Table employees: | idnumber | email | phone | address | Table webusers: - | idnumber | userid | website | -

an update select question

2003-11-05 Thread Jason Joines
I have a table called employees on a 3.23.48 server. One of it's fields is an email address (email) and one is the userid. The primary key is idnumber. I need to populate the userid field from the email address field. I can get the userid using: SELECT

Re: an update select question

2003-11-05 Thread gerald_clark
update employees set userid=substring(. Jason Joines wrote: I have a table called employees on a 3.23.48 server. One of it's fields is an email address (email) and one is the userid. The primary key is idnumber. I need to populate the userid field from the email address field. I can

RE: an update select question

2003-11-05 Thread Chris
To: [EMAIL PROTECTED] Subject: an update select question I have a table called employees on a 3.23.48 server. One of it's fields is an email address (email) and one is the userid. The primary key is idnumber. I need to populate the userid field from the email address field. I can get the userid

Re: an update select question

2003-11-05 Thread Jason Joines
gerald_clark wrote: update employees set userid=substring(. Jason Joines wrote: I have a table called employees on a 3.23.48 server. One of it's fields is an email address (email) and one is the userid. The primary key is idnumber. I need to populate the userid field from the email

Re: another insert select question

2003-11-05 Thread Jason Joines
ideas? Thanks, Jason === Turns out I need UPDATE SET UPDATE employees SET userid=substring(email,1,instr(email,'@')-1); Solution provided to me in the an update select question thread. Jason === -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

another insert select question

2003-11-04 Thread Jason Joines
Table employees: | idnumber | email | phone | address | Table webusers: - | idnumber | userid | website | - Table employees is completely populated. Table

Re: Insert ... Select question

2003-10-29 Thread
I use this syntax but I have privilege problem. Thenk you anyway - Original Message - From: Nitin [EMAIL PROTECTED] To: IEEIO AAOOCO [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, October 27, 2003 5:20 PM Subject: Re: Insert ... Select question of course, the syntax is: insert

Insert ... Select question

2003-10-27 Thread
Hello list I want to insert ... select data from table1 of db1 to table2 of db3. Is that possible? Thank in advance -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Insert ... Select question

2003-10-27 Thread Nitin
27, 2003 8:28 PM Subject: Insert ... Select question Hello list I want to insert ... select data from table1 of db1 to table2 of db3. Is that possible? Thank in advance -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com

RE: Insert ... Select question

2003-10-27 Thread Fortuno, Adam
... Select question Hello list I want to insert ... select data from table1 of db1 to table2 of db3. Is that possible? Thank in advance -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General

RE: SELECT Question

2003-10-22 Thread Barry Byrne
-Original Message- From: Jean-Pierre Schwickerath [mailto:[EMAIL PROTECTED] Hello Mumba, Hello Barry, How do I select out and filter only rows that match both 16 and 62 in the KEYW_ID col? IE. The query would return only 119 and 108? I'm sure this could be done more

SELECT Question

2003-10-20 Thread Mumba Chucks
Hi, I've been given a table to work with, and I'm not meant to change it: - | TABLE_NAME| TBL_IDX | KEYW_ID | - | PROPERTIES| 108 | 16 | - | PROPERTIES| 119 | 16

RE: SELECT Question

2003-10-20 Thread Barry Byrne
-Original Message- From: Mumba Chucks [mailto:[EMAIL PROTECTED] I've been given a table to work with, and I'm not meant to change it: - | TABLE_NAME | TBL_IDX | KEYW_ID | - | PROPERTIES | 108 | 16

Re: SELECT Question

2003-10-20 Thread Jean-Pierre Schwickerath
Hello Mumba, Hello Barry, How do I select out and filter only rows that match both 16 and 62 in the KEYW_ID col? IE. The query would return only 119 and 108? I'm sure this could be done more effeciently other ways, possibly with a sub select if available, but something like this

newbie SELECT question

2003-10-01 Thread Graham Nichols
Hi, I have a table containing page referral URLs gleaned from users browsing my website. Is there a way for me to use SELECT based on a portion record's contents? eg table contents: http://www.yahoo.com/adirectory/apage.htm http://google.net/adirectory/anotherpage.php I wish to return only

RE: newbie SELECT question

2003-10-01 Thread Percy Williams
Could look at instr? -Original Message- From: Graham Nichols [mailto:[EMAIL PROTECTED] Sent: 01 October 2003 14:54 To: [EMAIL PROTECTED] Subject: newbie SELECT question Hi, I have a table containing page referral URLs gleaned from users browsing my website. Is there a way

Re: newbie SELECT question

2003-10-01 Thread Michael Johnson
How about this? SELECT SUBSTRING_INDEX(SUBSTRING(url, LOCATE(//, url) + 2), '/', 1) AS domain FROM referals Michael On Wed, 1 Oct 2003 14:54:24 +0100, Graham Nichols [EMAIL PROTECTED] wrote: Hi, I have a table containing page referral URLs gleaned from users browsing my website. Is there a

Newbie SELECT Question

2003-08-17 Thread Steve Cote
We are having problems with what we think is a simple select statement: select ENTITY from ATTRIBUTE where (NAME='FavoriteSport' and VALUE='Soccer') and (NAME='FavoriteFood' and VALUE='CornDogs'); First, we are running an older version of MySQL: mysql select version(); +--+

Re: Newbie SELECT Question

2003-08-17 Thread Hans-Peter Grimm
Steve Cote wrote: We are having problems with what we think is a simple select statement: select ENTITY from ATTRIBUTE where (NAME='FavoriteSport' and VALUE='Soccer') and (NAME='FavoriteFood' and VALUE='CornDogs'); You are trying to find a row with a NAME value of 'FavoriteSport' and

Re: Newbie SELECT Question

2003-08-17 Thread Ivan Cukic
Steve select ENTITY from ATTRIBUTE where (NAME='FavoriteSport' and Steve VALUE='Soccer') and (NAME='FavoriteFood' and VALUE='CornDogs'); Steve Empty set (0.00 sec) Just analyze the query. You asked for a record in which name = 'FavoriteSport' AND name = 'FavoriteFood' which is always false

SELECT question

2003-06-11 Thread danchik
I have a question on how to substitute a subselect in mysql. For example lets say i have 3 tables Cars, Options and CarOptions Cars consists of: uid, make Options consists of: uid, option CarOption consists of: uid, Caruid, Optionsuid I want to select all Cars that have ALL of requested

Simple SELECT question

2003-03-05 Thread nocturno
I need a little help querying 2 tables in MySQL; Table User User_Id // Id = 2 User_Name // John Table History User_Id // 2 User_History // John has born in 58 SELECT User_History FROM History WHERE User_Id = 2; // return John has born in 58 But what my SELECT should look if i don't know

RE: Simple SELECT question

2003-03-05 Thread Mike Hillyer
:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2003 10:41 AM To: [EMAIL PROTECTED] Subject: Simple SELECT question I need a little help querying 2 tables in MySQL; Table User User_Id // Id = 2 User_Name // John Table History User_Id // 2 User_History // John has born in 58 SELECT User_History

Re: Simple SELECT question

2003-03-05 Thread Bruce Feist
[EMAIL PROTECTED] wrote: I need a little help querying 2 tables in MySQL; Table User User_Id // Id = 2 User_Name // John Table History User_Id // 2 User_History // John has born in 58 SELECT User_History FROM History WHERE User_Id = 2; // return John has born in 58 But what my SELECT

Re: Simple SELECT question

2003-03-05 Thread Ryan McDougall
--- [EMAIL PROTECTED] wrote: I need a little help querying 2 tables in MySQL; Table User User_Id // Id = 2 User_Name // John Table History User_Id // 2 User_History // John has born in 58 SELECT User_History FROM History WHERE User_Id = 2; // return John has born in 58 But

Re[2]: Select question

2003-02-10 Thread Stefan Hinz
C, After some struggling, I have managed to get the problem below 99% working, the problem now is that I can't get them in descending order. Here is my select statement. $query = select manager.name, position, MAX(goals) from roster join reference join manager where

Re: Select question

2003-02-10 Thread Diana Soares
want: Fred 87 Bill 70 John 48 TIA - Original Message - From: C. Reeve [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Friday, February 07, 2003 1:57 PM Subject: Select question Hi, I have a database with 3 names in it. In each of these names is 5

Select question

2003-02-09 Thread C. Reeve
Hi, I have a database with 3 names in it. In each of these names is 5 categories that have numbers in them. I want to be able to do a select and get the top number from each category for each name and display them from most to least. I have checked all the docs on the select statement, but

Re: Select question

2003-02-09 Thread C. Reeve
PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Friday, February 07, 2003 1:57 PM Subject: Select question Hi, I have a database with 3 names in it. In each of these names is 5 categories that have numbers in them. I want to be able to do a select and get the top number from each category

RE: select question

2002-12-07 Thread Adolfo Bello
Use the CONCAT function Adolfo -Original Message- From: tag [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 3:57 AM To: [EMAIL PROTECTED] Subject: select question HI, I need to do a select query that can do the following: select * from table where col1 like hex

select question

2002-12-06 Thread tag
HI, I need to do a select query that can do the following: select * from table where col1 like hex(somestring); My problem is HOW do I get the % in there??? The Mysql Server is 4.0.4 and the table has a blob field with hex stored in it Thanks Tonino

Re: select question

2002-12-06 Thread Roger Baklund
* tag I need to do a select query that can do the following: select * from table where col1 like hex(somestring); This was a bit confusing... :) hex(somestring) will always return 0, unless the string is a numerical value: mysql select hex('65'),hex(65),hex(A);

Re: select question

2002-12-06 Thread Roger Baklund
* Tonino Greco Thanks - but I got it working : select * from table where col1 like concat(%, hex(somestring), %); the hex(somestring) - returns :736F6D65737472696E67 * me hex(somestring) will always return 0, unless the string is a numerical value Sorry for that, this was changed in 4.0.1,

Re: Mysql SELECT question (LEFT JOIN?)

2002-11-15 Thread John Ragan
by now, i hope, you've gotten answers from the sql gurus on the list, so i won't clutter with my humble attempts. your comment about problems with joins indicates that corereader might be of some help to you if you have a windows box for a front end. it will let you do quick

re: Mysql SELECT question (LEFT JOIN?)

2002-11-15 Thread Victoria Reznichenko
Eric, Friday, November 15, 2002, 1:36:54 AM, you wrote: EA Assume two tables: EA CREATE TABLE block_ip ( EA datestamp int(11) NOT NULL default '0', EA remote_addr char(15) NOT NULL default '', EA PRIMARY KEY (remote_addr), EA KEY datestamp (datestamp) EA ) TYPE=MyISAM; EA CREATE TABLE

INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
Hello, I recently stumbled upon the INSERT INTO..SELECT abilities. Basically what I'm doing is archiving records into another table before deleting them (inventory information). However, I'd like to have the archive table to have one more field than the original table: a date_archived function.

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
Well, amazingly enough, it works great! I found a test box to try it on first before implementing this on the production box. This will definitely make life easier... On Thu, 2002-11-14 at 10:14, gerald_clark wrote: Did you try it? Did it work? Greg Macek wrote: Hello, I recently

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Matthew Baranowski
Assessment University of Washington - Original Message - From: Greg Macek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 14, 2002 8:06 AM Subject: INSERT INTO ... SELECT question Hello, I recently stumbled upon the INSERT INTO..SELECT abilities. Basically what I'm

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
, Office of Educational Assessment University of Washington - Original Message - From: Greg Macek [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 14, 2002 8:06 AM Subject: INSERT INTO ... SELECT question Hello, I recently stumbled upon the INSERT

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Paul DuBois
At 11:15 -0600 11/14/02, Greg Macek wrote: Thanks for the tip! Looks like I can change my date_archived field to timestamp(8), since all I care about for this is the date information (actual time is useless to me). My sql query all of a sudden got a lot simpler. Thanks again for the help!

Mysql SELECT question (LEFT JOIN?)

2002-11-14 Thread Eric Anderson
Assume two tables: CREATE TABLE block_ip ( datestamp int(11) NOT NULL default '0', remote_addr char(15) NOT NULL default '', PRIMARY KEY (remote_addr), KEY datestamp (datestamp) ) TYPE=MyISAM; CREATE TABLE brute_force ( datestamp int(11) NOT NULL default '0', remote_addr char(15)

Select question

2002-09-10 Thread Elin Röös
Hi, I have a table called users with the columns firstname and lastname. I would like to do a search on the fullname and have tried: select * from users where (firstname + ' ' + lastname) = John Smith which returns all rows for some reason and not only the rows with users named John Smith

re: Select question

2002-09-10 Thread Egor Egorov
Elin, Tuesday, September 10, 2002, 12:03:21 PM, you wrote: ER I have a table called users with the columns firstname and lastname. I would ER like to do a search on the fullname and have tried: ER select * from users where (firstname + ' ' + lastname) = John Smith ER which returns all rows for

Re: Select question

2002-09-10 Thread Nicholas Stuart
You would have to do something like: SELECT * FROM users WHERE CONCAT(firstname, , lastname) = John Smith That should get you what you want. If your taking your DB from MS SQL to MySQL only a few queries will port directly over. You have to be careful that you follow the MySQL syntax and

A Date and Select question.

2002-05-28 Thread I. TS
My SQL query problem: I met a strange problem: For example, I have the following table: Mytable: No Name Date Project 1 Bob 2002-05-27Bob's project 2 John -00-00 John's project When I use select * from

Re: SELECT Question.

2002-03-02 Thread BD
At 01:22 AM 3/3/2002 , you wrote: I need to pull a variable number of fields from a table from the last inputted fields. For example, instead of doing something like SELECT * FROM table I am looking for a way to do something like this(hypothetical, I don't really know what I should do).

Re: INSERT SELECT QUESTION

2001-09-09 Thread Paul DuBois
At 8:44 PM -0500 9/9/01, Marcus Young wrote: Hi, I'm fairly new to MySQL. I'm trying to insert data into a table where one field is derived from a SELECT on another table (a key) and the other fields are defined directly (eg field_01=abcd) . The formats I have been trying don't appear to be

Re: INSERT SELECT QUESTION

2001-09-09 Thread Calvin Chin
PROTECTED] Date: Sun, 09 Sep 2001 20:44:23 -0500 Subject: INSERT SELECT QUESTION Hi, I'm fairly new to MySQL. I'm trying to insert data into a table where one field is derived from a SELECT on another table (a key) and the other fields are defined directly (eg field_01=abcd) . The formats I

Re: SELECT question.

2001-05-31 Thread Scott Alexander
On 30 May 2001, at 10:14, Paul DuBois wrote: At 9:41 AM -0700 5/30/01, Richard Reina wrote: I am stuck on a select query and was wondering if someone could help. I have I've written a database app. that helps me run my business (trucking). I need however to write a query that shows me all

  1   2   >