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 wrote: > 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 do

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" wrote: 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 d

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:http://lis

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

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 newslettercon

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 t

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]

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

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 jo

RE: Select question

2007-10-25 Thread Jerry Schwartz
> Sent: 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 sele

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 bo

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? Tha

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, al

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 table1.n

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

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 t

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 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 part

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 th

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 log

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: 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 a

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 creativ

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) (B>FROM NGLDENHDT (B>WHERE KAI_CDE = :KAI_CDE_T1 (B>

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) (B>

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 > W

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 AND

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

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

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 se

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

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-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-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 followin

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 . Michael Feghhi, Jalil wrote: Is there a way to convert the following result set: id f2

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 same

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 versi

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

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

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 anal

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

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 |

RE: INSERT ... SELECT question

2004-03-29 Thread Eric J. Janus
res me to alter 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: IN

RE: INSERT ... SELECT question

2004-03-29 Thread Henrik Schröder
dd 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

RE: INSERT ... SELECT question

2004-03-29 Thread Eric J. Janus
tterley [mailto:[EMAIL PROTECTED] > Sent: Monday, 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*). :

RE: INSERT ... SELECT question

2004-03-29 Thread Matt Chatterley
27; Subject: RE: 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 genera

RE: INSERT ... SELECT question

2004-03-29 Thread Eric J. Janus
ion, but I 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 ..

RE: INSERT ... SELECT question

2004-03-29 Thread Matt Chatterley
d_col, 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 co

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 ent

Re: another insert select question

2003-11-05 Thread Jason Joines
esults into the userid field. Any 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 Genera

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 ad

RE: an update select question

2003-11-05 Thread Chris
9:14 AM 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

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

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 substring(per_email_address,1,instr(

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 | -

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 | > -

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 webuse

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

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: Insert ... Select question

2003-10-27 Thread Nitin
CTED]> Sent: Monday, October 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 archiv

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: 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 cou

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 t

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

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: 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 ther

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 brow

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 th

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 bec

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 'Favor

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(); +--+

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 optio

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

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 should

RE: Simple SELECT question

2003-03-05 Thread Mike Hillyer
D] [mailto:[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 Us

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 t

Re: Select question

2003-02-10 Thread Diana Soares
desc"; > > Using the example below, this is what I get: > > Bill 70 > John 48 > Fred 87 > > This is what I want: > > Fred 87 > Bill 70 > John 48 > > TIA > - Original Message - > From: "C. Reeve" <[EMAIL P

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 >manager.idn=

Re: Select question

2003-02-09 Thread C. Reeve
age - 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 > categories that have numbers in

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 thi

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: >

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 ch

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"); +---+-+

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: 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

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 point-and-click

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) NO

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! TIMEST

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Greg Macek
ally. > > Thanks, > > Matt > > Matthew P Baranowski > Data Manager, Office of Educational Assessment > University of Washington > > - Original Message - > From: Greg Macek <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, N

Re: INSERT INTO ... SELECT question

2002-11-14 Thread Matthew Baranowski
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 IN

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 rec

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. So

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 func

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 row

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 (w

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 "sel

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 shou

SELECT Question.

2002-03-02 Thread Eric Harrison
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). "SELECT LAST_TEN_FIELDS FROM

Re: INSERT SELECT QUESTION

2001-09-09 Thread Calvin Chin
;[EMAIL PROTECTED]> To: <[EMAIL 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 &

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

  1   2   >