Help with SELECT clause

2009-11-21 Thread Ashley M. Kirchner
I'm stuck again ... and perhaps it's just not designed right, but I inherited this setup, so if anyone has suggestions on how to make it better, I'm all ears. This is all one table ... describe approvals; +---+--+--+-+-++ | Field

Help with SELECT and possible JOIN

2009-01-19 Thread Duane Hill
I have two tables defined: CREATE TABLE `tga_body` ( `body_id` int(10) unsigned NOT NULL auto_increment, `blob_pos` mediumint(8) unsigned NOT NULL, `file_id` int(10) unsigned NOT NULL, `blob_id` int(10) unsigned NOT NULL, PRIMARY KEY USING BTREE (`body_id`),

Re: Help with SELECT and possible JOIN

2009-01-19 Thread Duane Hill
On Mon, 19 Jan 2009, Duane Hill wrote: I have two tables defined: CREATE TABLE `tga_body` ( `body_id` int(10) unsigned NOT NULL auto_increment, `blob_pos` mediumint(8) unsigned NOT NULL, `file_id` int(10) unsigned NOT NULL, `blob_id` int(10) unsigned NOT NULL,

help with select

2007-12-05 Thread Hiep Nguyen
hi list, i have two tables: idea(iid int not null primary_key auto_increment, completed_by int, submitted_by int); employee(eid int not null primary_key auto_increment, first varchar(20), last varchar(30)); table idea data: 1 | 4 | 10 2 | 3 | 7 table employee data: 3 | john | Doe 4

Re: help with select

2007-12-05 Thread Andy Wallace
You might try this: SELECT I.iid, CONCAT(ECOMP.last, ', ', ECOMP.first) AS 'Completed By', CONCAT(ESUB.last, ', ', ESUB.first) AS 'Submitted By', FROM idea I JOIN employee ECOMP ON I.completed_by = ECOMP.eid JOIN employee ESUB ON I.submitted_by = ESUB.eid andy Hiep Nguyen

Re: help with select

2007-12-05 Thread Martin Gainty
PROTECTED] To: mysql@lists.mysql.com Sent: Wednesday, December 05, 2007 2:02 PM Subject: help with select hi list, i have two tables: idea(iid int not null primary_key auto_increment, completed_by int, submitted_by int); employee(eid int not null primary_key auto_increment, first varchar(20

Help please: SELECT in binlog?

2007-04-19 Thread Fionn Behrens
We recently switched to mysql5 and while we were at it we also changed our logs from text to bin as suggested by the migration script we had (probably created by debian people). Now I unfortunately had to reconstruct what had happened during a faulty run of our application and I could not get

Re: Help please: SELECT in binlog?

2007-04-19 Thread Jay Pipes
Fionn Behrens wrote: We recently switched to mysql5 and while we were at it we also changed our logs from text to bin as suggested by the migration script we had (probably created by debian people). Now I unfortunately had to reconstruct what had happened during a faulty run of our application

Re: Help please: SELECT in binlog?

2007-04-19 Thread Fionn Behrens
On Do, 2007-04-19 at 13:57 -0400, Jay Pipes wrote: You can have both, AFAIK. The general query log keeps all queries, including SELECTs. Binlog only has data-modifying queries. Thanks very much for your answer. Maybe the fact that binlogs apparently are quite different from normal text

Re: Help please: SELECT in binlog?

2007-04-19 Thread David Precious
Fionn Behrens wrote: On Do, 2007-04-19 at 13:57 -0400, Jay Pipes wrote: You can have both, AFAIK. The general query log keeps all queries, including SELECTs. Binlog only has data-modifying queries. Thanks very much for your answer. Maybe the fact that binlogs apparently are quite

Query help for Select

2007-02-13 Thread balaraju mandala
Hi All, I need help in this procedure, i am limiting the result to single row by using 'limit' in select statement. But i am using a variable here, mysql is throwing error as i am using variable, please give some suggestions. create procedure Report_login_Activity2() begin declare count,i int

help with SELECT BETWEEN

2006-04-25 Thread Chris
I want to create a SELECT statement using BETWEEN like: SELECT * FROM mytable WHERE myfield BETWEEN value_1 AND value_2. The field I'm applying my BETWEEN clause is a varchar. Now, if value_1 and value_2 are numbers the select statement works as is. If value_1 and value_2 are characters I need

Re: help with SELECT BETWEEN

2006-04-25 Thread Chris White
On Tuesday 25 April 2006 09:33 am, Chris wrote: I want to create a SELECT statement using BETWEEN like: SELECT * FROM mytable WHERE myfield BETWEEN value_1 AND value_2. The field I'm applying my BETWEEN clause is a varchar. If the appropriate format (enclosing or not enclosing with

Re: help with SELECT BETWEEN

2006-04-25 Thread Shawn Green
--- Chris [EMAIL PROTECTED] wrote: I want to create a SELECT statement using BETWEEN like: SELECT * FROM mytable WHERE myfield BETWEEN value_1 AND value_2. The field I'm applying my BETWEEN clause is a varchar. Now, if value_1 and value_2 are numbers the select statement works as is.

Need help with SELECT

2004-12-30 Thread Rhino
I am trying to think of SQL that will let me show a one to many relationship as a single row in a result set. They say a picture is worth a thousand words so let me draw that picture. Event_IDEvent_Nameetc. 1 Concert 2 Art Exhibit 3 Spelling Bee

Re: Need help with SELECT

2004-12-30 Thread Neculai Macarie
There is one record in the Events table for each event that an organization is promoting. For each event, there could be 0 to 'n' files that give more information about the event, such as pictures, audio clips, or whatever. I want to display all the information about the event, including all

Re: Need help with SELECT

2004-12-30 Thread Rich Ryan
- Original Message - From: Rhino [EMAIL PROTECTED] To: mysql mysql@lists.mysql.com Sent: Thursday, December 30, 2004 9:03 AM Subject: Need help with SELECT I am trying to think of SQL that will let me show a one to many relationship as a single row in a result set. They say a picture

Newbie HELP. Using SELECT in Query Browser to retrieve records

2004-10-14 Thread Janjs Jangori
Am new to mysql and have some difficulty in retrieveing data from 3 tables using the Query Browser(version 1.0.8). I have 3 tables (axkde, axuser,axdev). All 3 tables have 'id','sender','reply'fields. Id is unique in all 3 tables. Now I want a query to extract data from the 3 tables.

Re: Help on Select/Join

2003-12-30 Thread Bob Terrell
on 12/29/03 12:00 PM, Bjoern Wuest wrote: Hello I have the following problem: Table1 'pl': +---+---+ | p | o | +---+---+ Table2 'ln': +---+--+---+ | p | l | v | +---+--+---+ Now my problem: how to write a statement to select all 'p' and 'v' from 'pl' and 'ln' where

Re: Help on Select/Join

2003-12-30 Thread Bjoern Wuest
Dear all, thank you very much for the fast and numerous responses. The idea of Roger Baklund does exactly what I want. Thank you very much Roger. I oversee the possibility to use IF conditions on MySQL server, this is what I wanted to do programmatically but to do in the DB server is ok. Let's

Help on Select/Join

2003-12-29 Thread Bjoern Wuest
Hello I work on this problem for three days now and could not find any tip in any manual, book, tutorial or search engine. I have the following problem: Table1 'pl': +---+---+ | p | o | +---+---+ | 1 | 1 | | 2 | 1 | | 3 | 2 | +---+---+ Table2 'ln': +---+--+---+ | p | l | v |

Re: Help on Select/Join

2003-12-29 Thread Roger Baklund
* Bjoern Wuest I work on this problem for three days now and could not find any tip in any manual, book, tutorial or search engine. I have the following problem: Table1 'pl': +---+---+ | p | o | +---+---+ | 1 | 1 | | 2 | 1 | | 3 | 2 | +---+---+ Table2 'ln': +---+--+---+ |

Help with SELECT statement for date range

2003-08-19 Thread Rob Sirota
Hello, I am having a problem when doing a SELECT. Here is the scenerio: I have a table that has an event StartDate and EndDate, based on the current Date NOW() I need to know which records are currently active. Can anyone help with a quick SELECT statement? Thanks. =

Re: Help with SELECT statement for date range

2003-08-19 Thread Antony Dovgal
On Tue, 19 Aug 2003 04:11:32 -0700 (PDT) Rob Sirota [EMAIL PROTECTED] wrote: Hello, I am having a problem when doing a SELECT. Here is the scenerio: I have a table that has an event StartDate and EndDate, based on the current Date NOW() I need to know which records are currently active.

RE: Help with SELECT statement for date range

2003-08-19 Thread Ralph Guzman
SELECT * FROM table_name WHERE EndDate now(); Is this what you need? -Original Message- From: Rob Sirota [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 4:12 AM To: [EMAIL PROTECTED] Subject: Help with SELECT statement for date range Hello, I am having a problem when doing

Re: Help with SELECT statement for date range

2003-08-19 Thread shaag
Hi, try this: SELECT * FROM your_table WHERE StartDate NOW() AND EndDate NOW() Hello, I am having a problem when doing a SELECT. Here is the scenerio: I have a table that has an event StartDate and EndDate, based on the current Date NOW() I need to know which records are currently

any help with select query??

2003-07-24 Thread Debusal
I have table one and table two I want to show all records from table one but also check if in table two is record that are in table one so if this is ture then bla=1 if false then bla=2 is it possible? query-select tableone.user,tabletwo.user from tableone,tabletwo

RE: any help with select query??

2003-07-24 Thread Rob
] Subject: any help with select query?? I have table one and table two I want to show all records from table one but also check if in table two is record that are in table one so if this is ture then bla=1 if false then bla=2 is it possible? query-select tableone.user

Re: need help with select statement

2003-07-08 Thread Paul DuBois
At 4:20 -0500 7/7/03, Anthony Scism wrote: I am relatively new at this, but is there any way to perform the following: | obs_date | date | YES | | NULL | | | obs_time | time | YES | | NULL | | | object | varchar(40) | YES | | NULL

need help with select statement

2003-07-07 Thread Anthony Scism
I am relatively new at this, but is there any way to perform the following: | obs_date | date | YES | | NULL | | | obs_time | time | YES | | NULL | | | object | varchar(40) | YES | | NULL | | | observing_site |

Re: need help with select statement

2003-07-07 Thread Nils Valentin
Hi Antony, Eventually key is a reserved word ?? ;-) nice one !! Best regards Nils Valentin Tokyo/Japan 2003 7 7 18:20Anthony Scism : I am relatively new at this, but is there any way to perform the following: | obs_date | date | YES | | NULL | | | obs_time

Re: need help with select statement

2003-07-07 Thread Nils Valentin
: Thank you very much, I should have thought of that. -Original Message- From: Nils Valentin [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 4:34 AM To: Anthony Scism; [EMAIL PROTECTED] Subject: Re: need help with select statement Hi Antony, Eventually key is a reserved word

RE: Help with SELECT, JOIN and WHERE query

2003-01-29 Thread heiko mundle
: Re: Help with SELECT, JOIN and WHERE query From: Stefan Hinz, iConnect \(Berlin\) Date: Wed, 29 Jan 2003 00:02:22 +0100 Victor, good shot! I thought of this one in the first place: SELECT u.user_id FROM user_profile u LEFT JOIN team_member t ON u.user_id = t.user_id WHERE t.team_id 2

Help with SELECT, JOIN and WHERE query

2003-01-28 Thread heiko mundle
Hi, I got a difficult problem with a SELECT query: In my application there are two tables, one for all users (user_profile) one for a user-in-team relation. I want to know, which user is still not in a speciffic team. Users can be in more than one team, but we don't care about that. Example:

Re: Help with SELECT, JOIN and WHERE query

2003-01-28 Thread Dobromir Velev
- From: heiko mundle [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, January 28, 2003 16:08 Subject: Help with SELECT, JOIN and WHERE query Hi, I got a difficult problem with a SELECT query: In my application there are two tables, one for all users (user_profile) one for a user

Help with SELECT, JOIN and WHERE query

2003-01-28 Thread Richard Joyce
If you have mySql 4 use a sub-query select user_id from user_profile where user_id not in (select user_id from team_member where team_id = 2) Hi, I got a difficult problem with a SELECT query: In my application there are two tables, one for all

RE: Help with SELECT, JOIN and WHERE query

2003-01-28 Thread Victor Pendleton
SELECT u.user_id FROM user_profile u LEFT JOIN team_member t ON u.user_id = t.user_id WHERE t.team_id 2 -Original Message- From: heiko mundle [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 8:08 AM To: [EMAIL PROTECTED] Subject: Help with SELECT, JOIN and WHERE query Hi, I

Re: Help with SELECT, JOIN and WHERE query

2003-01-28 Thread William R. Mussatto
Hi, I got a difficult problem with a SELECT query: In my application there are two tables, one for all users (user_profile) one for a user-in-team relation. I want to know, which user is still not in a speciffic team. Users can be in more than one team, but we don't care about that. What

Re: Help with SELECT, JOIN and WHERE query

2003-01-28 Thread gerald_clark
WHERE team_member.user_id IS NULL William R. Mussatto wrote: Hi, I got a difficult problem with a SELECT query: In my application there are two tables, one for all users (user_profile) one for a user-in-team relation. I want to know, which user is still not in a speciffic team. Users can

Re: Help with SELECT, JOIN and WHERE query

2003-01-28 Thread Stefan Hinz, iConnect \(Berlin\)
Subject: RE: Help with SELECT, JOIN and WHERE query SELECT u.user_id FROM user_profile u LEFT JOIN team_member t ON u.user_id = t.user_id WHERE t.team_id 2 -Original Message- From: heiko mundle [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 8:08 AM To: [EMAIL PROTECTED] Subject

Help With SELECT

2002-12-04 Thread Roger Davis
I need some help on a select if it is possible. Take for Example the following data. -- | RUSH | FileNumber | PTime | PDate | -- | 1 | 1-1023-001 | 08:00 | 12/04 | | 1 | 1--001 | 06:00 | 12/04 | | 0 | 1-1023

Need help with SELECT and JOIN pls

2001-12-07 Thread Jaime Teng
Hi, I have two tables: mysql describe eventlog; +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+--+--+-+-++ | id |

Re: Need help with SELECT and JOIN pls

2001-12-07 Thread Mikel King
I'm no expert in this in fact I just recently started playing with joins, but here's one that I actually used for a recent shopprt cart piece. I appologise if it wraps but the output is long...content conatins the basic content info but product contains the list of prices. Yes I could have

SV: Need help with SELECT 2 tables from choice of 3

2001-11-22 Thread Torgil Zechel
: Re: Need help with SELECT 2 tables from choice of 3 Why no have 3 tables: Members Data TheseMembersAreOld Members and Data are as you have them defined. TheseMembersAreOld contains only the Member_ID field. You then make the Member_ID field primary key on TheseMembersAreOld and Members. You can

SV: Need help with SELECT 2 tables from choice of 3

2001-11-22 Thread Torgil Zechel
You can join all three tables together select d.members_id, m.name, old.name from data as d left join members as m on m.members_id=d.members_id left join oldmembers as old on old.members_id=d.members_id If the members_id belongs to an old member, all fields from the member table

Need help with SELECT 2 tables from choice of 3

2001-11-21 Thread Jerry
Hi there I need help :-)) If anybody could be so kind and help me... I have 3 tables: OldMembers Memebers Data In Data there is a field Member_ID. Now in this field all members bigger than 100.000 are old ones and must be taken from the OldMembers table (both tables are not using same data so

Re: Need help with SELECT 2 tables from choice of 3

2001-11-21 Thread Thomas S. Iversen
OldMembers Memebers Data Why no have 3 tables: Members Data TheseMembersAreOld Members and Data are as you have them defined. TheseMembersAreOld contains only the Member_ID field. You then make the Member_ID field primary key on TheseMembersAreOld and Members. You can then perform a very

Re: Need help with SELECT 2 tables from choice of 3

2001-11-21 Thread Jerry
Why no have 3 tables: Members Data TheseMembersAreOld Members and Data are as you have them defined. TheseMembersAreOld contains only the Member_ID field. You then make the Member_ID field primary key on TheseMembersAreOld and Members. You can then perform a very fast joins. Hm, thank you for

Re: need help with select statements

2001-08-30 Thread Ian Barwick
On Thursday 30 August 2001 15:28, Andre Konopka wrote: Hi, I have, three tables (one,two, three) with the rows id/value. id is the key for all the tables. with select value from one where id=xx; select value from two where id=xx; select value from three where id=xx; I can select

help with SELECT

2001-08-15 Thread bastian . wagner
hi, i have the following table username | permission admin | view testuser | view user2 | write admin| write admin| change ... | ... i want to select all the permissions from admin. the normal query will output the following: admin -

help with select

2001-06-08 Thread Jaime Teng
Hi How do I perform this query using one operation? SELECT * FROM tablename WHERE account = (select account from tablename where name='BILL'); What I want is to lists all entries who's account is the same with 'BILL'. Thus far, what I know is to extract the account of 'BILL' and then perform

Re: help with select

2001-06-08 Thread Augusto Cesar Castoldi
Let me see if I understood your question: select * from tablename a, tablename2 b where a.account='BILL' and a.account=b.account It's tow tables or just one table? because if it's just one table just do select * from tablename where account='BILL' see you, Augusto On Sat, 9 Jun 2001, Jaime

more help with SELECT statement

2001-03-05 Thread Chris Toth
Hi, A few days ago, I asked the list about a SELECT statement. I received 2 replies that didn't really work but helped me think about the problem some more. In my database I have 4 tables. For this one query, I am matching up data from 3 of these tables and then displaying them on a website.

Re: more help with SELECT statement

2001-03-05 Thread Bob Hall
Hi, A few days ago, I asked the list about a SELECT statement. I received 2 replies that didn't really work but helped me think about the problem some more. In my database I have 4 tables. For this one query, I am matching up data from 3 of these tables and then displaying them on a

Re: Help with SELECT statement.

2001-03-02 Thread btjones
SELECT request.id, request.date, request.type, request.status, faculty.f_name, faculty.l_name, action.id, faculty.id FROM request INNER JOIN faculty ON request.requested_by=faculty.id LEFT JOIN request ON action.request_id=request.id; Chris Toth [EMAIL PROTECTED] wrote: I'm trying to form a

Need help with select statement.

2001-02-26 Thread David Jacobowitz
Dear Sir, I have looked in the manual but could not find any clue so I am seeking your assistance. I have a table with 25 fields and I use most of these fields but not all in different DBI scripts. Currently I use: SELECT field_1, field_4, ...getting tired typing field names... FROM myTest;

Re: Need help with select statement.

2001-02-26 Thread David Jacobowitz
Thanks Rolf From: "Rolf Hopkins" [EMAIL PROTECTED] To: "David Jacobowitz" [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: Need help with select statement. Date: Tue, 27 Feb 2001 09:21:57 +0800 No it's not possible but you can just read in all tables anyway and ignore t