query question using REGEXP

2004-03-13 Thread award
Hi, I'm storing in a database numbers separated by comma if more than one number i.e Record # Column 112 21,2,5,6 31,12,24,45 4

Re: query question using REGEXP

2004-03-13 Thread Matt W
Hi Anthony, You don't need REGEXP for this; LIKE will do. Try something like this: ... WHERE CONCAT(',', Column, ',') LIKE '%,2,%' to search for rows that contain 2. Hope that helps. Matt - Original Message - From: award Sent: Saturday, March 13, 2004 2:16 PM Subject: query

Re: query question using REGEXP

2004-03-13 Thread Matt W
, then the query I gave will work fine for that because it adds a comma to the beginning and end of the column (with CONCAT()) before doing the LIKE comparison. Matt - Original Message - From: award Sent: Saturday, March 13, 2004 5:10 PM Subject: RE: query question using REGEXP Hi thanks

Query Question

2004-02-11 Thread Jack Lauman
I have a table containing information about different businesses. I want to randomly select a single row from the table using a prepared statement in a java bean. What is the most eficient way to do this? TIA Jack -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

Re: Query Question

2004-02-11 Thread Eamon Daly
] To: MySQL Mailing List [EMAIL PROTECTED] Sent: Wednesday, February 11, 2004 5:47 AM Subject: Query Question I have a table containing information about different businesses. I want to randomly select a single row from the table using a prepared statement in a java bean. What is the most eficient

Re: Query Question

2004-02-11 Thread Alec . Cawley
Jack Lauman [EMAIL PROTECTED] wrote on 11/02/2004 11:47:20: I have a table containing information about different businesses. I want to randomly select a single row from the table using a prepared statement in a java bean. What is the most eficient way to do this? Try SELECT columns

Newbie query question...

2004-02-04 Thread John Croson
I have a simple query: SELECT id,year,month,day,cat_id FROM events LEFT JOIN calendar_cat ON events.cat=calendar_cat.cat_id WHERE year=YEAR(CURDATE()) AND month=MONTH(CURDATE()) AND day=DAYOFMONTH(CURDATE()) AND cat_id='2' OR cat_id='5' AND approved='1' ORDER BY year,month,day ASC Results:

RE: Newbie query question...

2004-02-04 Thread Mike Johnson
From: John Croson [mailto:[EMAIL PROTECTED] I have a simple query: SELECT id,year,month,day,cat_id FROM events LEFT JOIN calendar_cat ON events.cat=calendar_cat.cat_id WHERE year=YEAR(CURDATE()) AND month=MONTH(CURDATE()) AND day=DAYOFMONTH(CURDATE()) AND cat_id='2' OR cat_id='5' AND

Re: Newbie query question...

2004-02-04 Thread Johan Hook
Hi John, I think you missed on the precedence of AND/OR if you change to AND (cat_id='2' OR cat_id='5' ) it should work as you want it to /Johan John Croson wrote: I have a simple query: SELECT id,year,month,day,cat_id FROM events LEFT JOIN calendar_cat ON events.cat=calendar_cat.cat_id WHERE

Re: Newbie query question...

2004-02-04 Thread Michael Stassen
Mike Johnson wrote: From: John Croson [mailto:[EMAIL PROTECTED] I have a simple query: SELECT id,year,month,day,cat_id FROM events LEFT JOIN calendar_cat ON events.cat=calendar_cat.cat_id WHERE year=YEAR(CURDATE()) AND month=MONTH(CURDATE()) AND day=DAYOFMONTH(CURDATE()) AND cat_id='2' OR

Re: Newbie query question...

2004-02-04 Thread mos
At 09:35 AM 2/4/2004, John Croson wrote: I have a simple query: SELECT id,year,month,day,cat_id FROM events LEFT JOIN calendar_cat ON events.cat=calendar_cat.cat_id WHERE year=YEAR(CURDATE()) AND month=MONTH(CURDATE()) AND day=DAYOFMONTH(CURDATE()) AND cat_id='2' OR cat_id='5' AND approved='1'

Re: Newbie query question...

2004-02-04 Thread Michael Satterwhite
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Wednesday 04 February 2004 16:03, mos wrote: At 09:35 AM 2/4/2004, John Croson wrote: I have a simple query: SELECT id,year,month,day,cat_id FROM events LEFT JOIN calendar_cat ON events.cat=calendar_cat.cat_id WHERE year=YEAR(CURDATE())

Re: SQL Query Question

2004-01-20 Thread sulewski
Hello, For my final solution I decided to use the inner join method. The query is created dynamically based upon a user interface component that allows people to build queries using parenthesis, ands and or's. Plus there is another field that I didn't include in the original question so as

Re: SQL Query Question

2004-01-20 Thread sulewski
I think I figured out the time problem. If I make s2 in the or s1 and remove any instances of s2 it works very fast with the 'or'. Joe On Tuesday, January 20, 2004, at 09:50 AM, sulewski wrote: Hello, For my final solution I decided to use the inner join method. The query is created

SQL Query Question

2004-01-19 Thread sulewski
Okay, I think I'm missing something obvious. I have two tables Table 1 Table 2 ___ _ ID rdid vid ___ _ ID in table 1 links to rdid in table 2. This

Re: SQL Query Question

2004-01-19 Thread sulewski
PM Subject: SQL Query Question Okay, I think I'm missing something obvious. I have two tables Table 1 Table 2 ___ _ ID rdid vid ___ _ ID in table 1

Fwd: SQL Query Question

2004-01-19 Thread sulewski
do it? :) - Original Message - From: sulewski [EMAIL PROTECTED] To: Jamie Murray [EMAIL PROTECTED] Sent: Monday, January 19, 2004 4:41 PM Subject: Re: SQL Query Question I asked a similar question but this time it's different. Last time I was looking for places where the record in table 1

Re: SQL Query Question

2004-01-19 Thread Michael Satterwhite
On Monday 19 January 2004 13:17, sulewski wrote: Okay, I think I'm missing something obvious. I have two tables Table 1 Table 2 ___ _ ID rdid vid ___

Re: SQL Query Question

2004-01-19 Thread Jochem van Dieten
Michael Satterwhite said: On Monday 19 January 2004 13:17, sulewski wrote: Okay, I think I'm missing something obvious. I have two tables Table 1 Table 2 ___ _ ID rdid vid

RE: SQL Query Question

2004-01-19 Thread Lincoln Milner
- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 4:39 PM To: [EMAIL PROTECTED] Subject: Re: SQL Query Question Michael Satterwhite said: On Monday 19 January 2004 13:17, sulewski wrote: Okay, I think I'm missing something obvious. I have two tables Table 1

Re: SQL Query Question

2004-01-19 Thread sulewski
Jochem, I believe this works. This is also easy to build dynamically. The query is going to be generated based upon some user input. Thank you very much, Joe On Monday, January 19, 2004, at 04:38 PM, Jochem van Dieten wrote: Michael Satterwhite said: On Monday 19 January 2004 13:17,

RE: SQL Query Question

2004-01-19 Thread Jochem van Dieten
Lincoln Milner said: Or, if I'm not mistaken, you could do something like: SELECT t1.* FROM table1 t1, table2 t2 WHERE t1.id = t2.rdid AND t2.vid IN (46, 554) ; That should work No. You are back to square one where there should only be one record in t2 with a vid of either 46 or

Re: SQL Query Question

2004-01-19 Thread Michael Satterwhite
On Monday 19 January 2004 15:38, Jochem van Dieten wrote: So let's make it 2 fields: SELECT t1.* FROM table1 t1, table2 t2 INNER JOIN table2 t3 ON (t2.rdid = t3.rdid AND t2.vid = 46 AND t3.vid = 554) WHERE t1.rdid = t2.rdid Add GROUP BY/DISTINCT per your requirements.

Re: SQL Query Question

2004-01-19 Thread Jochem van Dieten
Michael Satterwhite said: On Monday 19 January 2004 15:38, Jochem van Dieten wrote: So let's make it 2 fields: SELECT t1.* FROM table1 t1, table2 t2 INNER JOIN table2 t3 ON (t2.rdid = t3.rdid AND t2.vid = 46 AND t3.vid = 554) WHERE t1.rdid = t2.rdid Add GROUP BY/DISTINCT

Re: SQL Query Question

2004-01-19 Thread Michael Satterwhite
On Monday 19 January 2004 16:30, Jochem van Dieten wrote: Michael Satterwhite said: On Monday 19 January 2004 15:38, Jochem van Dieten wrote: So let's make it 2 fields: SELECT t1.* FROM table1 t1, table2 t2 INNER JOIN table2 t3 ON (t2.rdid = t3.rdid AND t2.vid = 46 AND

Re: SQL Query Question

2004-01-19 Thread Jochem van Dieten
Michael Satterwhite wrote: On Monday 19 January 2004 16:30, Jochem van Dieten wrote: Michael Satterwhite said: On Monday 19 January 2004 15:38, Jochem van Dieten wrote: So let's make it 2 fields: SELECT t1.* FROM table1 t1, table2 t2 INNER JOIN table2 t3 ON (t2.rdid = t3.rdid AND t2.vid

Date query question

2004-01-10 Thread Eric Anderson
I don't have much experience working with dates in Mysql; I've always prefered to manage dates in code, so bear with me. I've got the following definition (yes, no indexes right now): CREATE TABLE se_t ( datestamp timestamp(14) NOT NULL, remote_addr char(16) NOT NULL default '',

Query question (php)

2003-11-11 Thread Obantec Support1
Hi mysql 3.23.56 RH 8.0 I have got the sql query to work but is there a better way of writing the syntax? $sql = SELECT * FROM Contacts WHERE Categories=\$calltype\ and BusinessCodes !=\R\ and BusinessCodes !=\I\ and BusinessCodes !=\L\ ORDER BY Company ASC; basically i Categories (a limit

SQL query question

2003-11-11 Thread Paal Eriksen
Hi, i have the following query: SELECT person.name as Name, firmal.beskrivelse as Businessline, lokasjon.navn as Location FROM firmal INNER JOIN ( person INNER JOIN lokasjon ON person.lokid = lokasjon.lokid) ON firmal.firmalid = person.firmalid which will give me a list of Name, Businessline,

RE: SQL query question

2003-11-11 Thread Andy Eastham
] with the primary key of the person table. Andy -Original Message- From: Paal Eriksen [mailto:[EMAIL PROTECTED] Sent: 11 November 2003 12:11 To: [EMAIL PROTECTED] Subject: SQL query question Hi, i have the following query: SELECT person.name as Name, firmal.beskrivelse

RE: SQL query question

2003-11-11 Thread Paal Eriksen
So close, Thanks you very much Andy. I tried one similar to your suggestion, but didn't get quite the result i expected. Cheers Paal Ny versjon av Yahoo! Messenger Nye ikoner og bakgrunner, webkamera med superkvalitet og dobbelt så morsom

Re: Query question (php)

2003-11-11 Thread Roger Baklund
* Obantec Support1 mysql 3.23.56 RH 8.0 I have got the sql query to work but is there a better way of writing the syntax? $sql = SELECT * FROM Contacts WHERE Categories=\$calltype\ and BusinessCodes !=\R\ and BusinessCodes !=\I\ and BusinessCodes !=\L\ ORDER BY Company ASC; basically

Re: Query question (php)

2003-11-11 Thread Obantec Support1
- Original Message - From: Roger Baklund [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: Obantec Support1 [EMAIL PROTECTED] Sent: Tuesday, November 11, 2003 8:46 PM Subject: Re: Query question (php) * Obantec Support1 mysql 3.23.56 RH 8.0 I have got the sql query to work

Re: SQL query question

2003-11-11 Thread Leo
: Paal Eriksen To: [EMAIL PROTECTED] Sent: Tuesday, November 11, 2003 7:11 PM Subject: SQL query question SELECT person.name as Name, firmal.beskrivelse as Businessline, lokasjon.navn as Location FROM firmal INNER JOIN ( person INNER JOIN lokasjon ON person.lokid

MySQL query question

2003-11-07 Thread Chris A. Mattingly
I've searched around on the lists archives and even did some googling, but I'm having trouble finding the answer to this question. Given that I have a table with 2 columns (say col1, col2) I want to be able to search for the value of col1 in the value of col2. Let's say that in one instance

RE: MySQL query question

2003-11-07 Thread Andy Eastham
Chris, You're almost there! select * from temp where col2 like concat('%',col1, '%'); Andy -Original Message- From: Chris A. Mattingly [mailto:[EMAIL PROTECTED] Sent: 07 November 2003 17:01 To: [EMAIL PROTECTED] Subject: MySQL query question I've searched around on the lists

Re: Simple contains query question

2003-10-24 Thread Egor Egorov
Dale Hans [EMAIL PROTECTED] wrote: I have a field in the table, call it 'stuff', and it contains a list of values that are comma separated. i.e. 'Books,DVDs,Video Tapes,CDs' I want to SELECT out all records that have an item. I know IN works the other way, so is there something that

Simple contains query question

2003-10-23 Thread Dale Hans
I have a field in the table, call it 'stuff', and it contains a list of values that are comma separated. i.e. 'Books,DVDs,Video Tapes,CDs' I want to SELECT out all records that have an item. I know IN works the other way, so is there something that will get what I want like this: SELECT *

Select query question

2003-08-29 Thread Luis Lebron
I have a test results table that looks like this student_id test_id score 1 1 90 1 1 100 1 1 80 2 1 95 2 1 85 2 1

Re: Select query question

2003-08-29 Thread Bruce Feist
Luis Lebron wrote: I have a test results table that looks like this student_id test_id score 1 1 90 1 1 100 1 1 80 2 1 95 2 1 85 2

Query question

2003-08-19 Thread Jack Lauman
I have two tables, contact_account and contact. contact_account has two fields: contact_id (pk) and account_id contact has a PK of contact_id I to select all the columns in contact where account_id=13 I tried: SELECT * FROM (contacts INNER JOIN account on contact.contact_id =

Re: Query question

2003-08-19 Thread Keith C. Ivey
On 19 Aug 2003 at 13:17, Jack Lauman wrote: I have two tables, contact_account and contact. contact_account has two fields: contact_id (pk) and account_id contact has a PK of contact_id I to select all the columns in contact where account_id=13 I tried: SELECT * FROM (contacts

Re: Query question

2003-08-19 Thread Roger Baklund
* Jack Lauman I have two tables, contact_account and contact. contact_account has two fields: contact_id (pk) and account_id contact has a PK of contact_id I to select all the columns in contact where account_id=13 I tried: SELECT * FROM (contacts INNER JOIN account on

Re: Query question

2003-08-19 Thread Patrick Shoaf
Try SELECT * FROM contact INNER JOIN contact_account ON contact.contact_id=contact_account.contact_id WHERE contact_account.account_id = 13 At 04:17 PM 8/19/2003, Jack Lauman wrote: I have two tables, contact_account and contact. contact_account has two fields: contact_id (pk) and

RE: Select with join query question

2003-07-29 Thread Richard Bolen
Feist [mailto:[EMAIL PROTECTED] Sent: Monday, July 28, 2003 7:42 PM To: Richard Bolen Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Select with join query question Richard Bolen wrote: This works! I was then wondering how to get the total number of all jobs that this condition is true

Re: Select with join query question

2003-07-29 Thread Bruce Feist
]; [EMAIL PROTECTED] Subject: Re: Select with join query question Richard Bolen wrote: This works! I was then wondering how to get the total number of all jobs that this condition is true for? Just include count(distinct j.jobid) in the SELECT list. -- MySQL General Mailing List

Select with join query question

2003-07-28 Thread Richard Bolen
I'm trying to write a select query that involves 2 tables. One table (Submissions) has a one to many relationship with the other table (Jobs). I'm trying to find all the records in Jobs that do NOT have a corresponding record in Submissions with a status of 1. The problem I'm having is that

Re: Select with join query question

2003-07-28 Thread Brent Baisley
Something like this should work. You want to do a left join on Jobs so you don't filter out those without submission matches. The resulting left join will have a value of NULL for any fields joined from Submissions that don't have a match in Jobs. Just include at least on field from

RE: Select with join query question

2003-07-28 Thread Richard Bolen
I think this gets me all the Jobs that have no submissions but I'm really looking for any job that doesn't have a submission with a status of 1. That means I need Jobs that don't have submissions plus jobs with submissions with exclusively non-1 statuses. The problem is when a job has more

Re: Select with join query question

2003-07-28 Thread vze2spjf
From: Richard Bolen [EMAIL PROTECTED] Date: 2003/07/28 Mon PM 01:37:27 CDT To: [EMAIL PROTECTED] Subject: Select with join query question I'm trying to write a select query that involves 2 tables. One table (Submissions) has a one to many relationship with the other table (Jobs). I'm

Re: Select with join query question

2003-07-28 Thread Bruce Feist
[EMAIL PROTECTED] wrote: From: Richard Bolen [EMAIL PROTECTED] Date: 2003/07/28 Mon PM 01:37:27 CDT I'm trying to write a select query that involves 2 tables. One table (Submissions) has a one to many relationship with the other table (Jobs). I'm trying to find all the records in Jobs that do

Re: Select with join query question

2003-07-28 Thread Brent Baisley
I was wondering if you were going to come back with that. Your going to need to using grouping then. Something like this should do it: SELECT *,SUM(s.status) AS ActiveJob FROM Jobs AS j LEFT JOIN Submissions AS s ON j.job_id=s.job_id WHERE ActiveJob1 OR ActiveJob IS NULL GROUP BY j.job_id I'm

Re: Re: Select with join query question

2003-07-28 Thread vze2spjf
[snip] Rich's solution, which I edited out, was a good one. But, if you really want to do it with a single JOIN, try this: select j.* FROM Jobs j LEFT JOIN Submissions s ON j.jobid = s.jobid GROUP BY /* all selected columns */ HAVING min(abs(s.status - 1)) 0 I leave it as an exercise

RE: Re: Select with join query question

2003-07-28 Thread Richard Bolen
: Select with join query question [snip] Rich's solution, which I edited out, was a good one. But, if you really want to do it with a single JOIN, try this: select j.* FROM Jobs j LEFT JOIN Submissions s ON j.jobid = s.jobid GROUP BY /* all selected columns */ HAVING min(abs(s.status - 1)) 0

Re: Select with join query question

2003-07-28 Thread Bruce Feist
Richard Bolen wrote: This works! I was then wondering how to get the total number of all jobs that this condition is true for? Just include count(distinct j.jobid) in the SELECT list. Bruce select j.* FROM Jobs j LEFT JOIN Submissions s ON j.jobid = s.jobid GROUP BY /* all selected columns

Query Question - handheldspecs

2003-06-21 Thread Steve B.
Hi all, I'm working on a simple site to help me and others determine which handheld/game/phone to buy. Before it had a table like this: Phone,color y/n,wireless y/n, etc... Now it is many tables so that new fields can be added while the site is up without having to change the db structure.

RE: SQL query question

2003-06-20 Thread TheMechE
% Etc Etc That would be proper programming form... Did that make sense? -Original Message- From: Rolf C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 4:57 PM To: [EMAIL PROTECTED] Subject: SQL query question Hello all, I am a totally newby to MYSQL but here i go. I want

SQL query question

2003-06-19 Thread Rolf C
Hello all, I am a totally newby to MYSQL but here i go. I want to create an ASP page that shows an image (screendump of game) a game name a game description and an url. I created a database with the following table: filename, urldesc, desc Now i have to create an SQL query that will put this

RE: SQL query question

2003-06-19 Thread Mike Hillyer
Well, from what limited info I have, it looks like your image tag is not closed properly. Regards, Mike Hillyer www.vbmysql.com -Original Message- From: Rolf C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 2:57 PM To: [EMAIL PROTECTED] Subject: SQL query question

query question

2003-06-12 Thread Susan Ator
Is there a way to check if a field has x number of characters in it? I have a table with a column (phone) which, for the moment is varchar(25). I need to find those entries which have less than 10 characters. Can this be done? Thanks susan -- MySQL General Mailing List For list archives:

RE: query question

2003-06-12 Thread Mike Hillyer
SELECT * FROM mytable WHERE LENGTH(phone) 10; http://www.mysql.com/doc/en/String_functions.html Regards, Mike Hillyer www.vbmysql.com -Original Message- From: Susan Ator [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: query question

RE: query question

2003-06-12 Thread Jay Blanchard
[snip] Is there a way to check if a field has x number of characters in it? I have a table with a column (phone) which, for the moment is varchar(25). I need to find those entries which have less than 10 characters. [/tuck] http://www.mysql.com/doc/en/String_functions.html mysql SELECT

RE: query question

2003-06-12 Thread Susan Ator
Thank y'all very very much. Each day I learn something new ;) susan -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Thursday, June 12, 2003 1:35 PM To: Susan Ator; [EMAIL PROTECTED] Subject: RE: query question [snip] Is there a way to check if a field has x

RE: Newbie Query Question

2003-03-16 Thread Uttam
: Newbie Query Question Hi all, My first post to this list. I have a query which I can't quite get to work. I was hoping that someone here could educate me a bit. I have two tables. tbl_people | id| fname|lname| --- | 1 |frank

Newbie Query Question

2003-03-15 Thread Charles Kline
Hi all, My first post to this list. I have a query which I can't quite get to work. I was hoping that someone here could educate me a bit. I have two tables. tbl_people | id| fname|lname| --- | 1 |frank |smith |

Re: Newbie Query Question

2003-03-15 Thread Jeff Kilpatrick
Charles- So, you have a table unique with respect to people (a person appears at most once), and a table with interests (some number of interests are associated a person in the first table. This is a one-to-many relationship. You need to join on the person in the first table. Something like

Re: Newbie Query Question

2003-03-15 Thread Charles Kline
Jeff, Thanks. This is ALMOST doing what I need. Suppose that the person could have from 0 - 5 records in tbl_peoples_interests and I need to have each one of those interests as a different name so I can use it in my PHP form? Thanks, Charles On Saturday, March 15, 2003, at 11:30 AM, Jeff

Re: Newbie Query Question

2003-03-15 Thread Jeff Kilpatrick
Charles- OK, let's say a person has `n' interest id entries in tbl_people_interests. It seems like you're wanting a result set with one row per person and (n + 2) (assuming you're selecting first and last name with the interests). I'm no UEbergeek with respect to SQL, but I don't think there's

Re: QUERY question (group by) - please help

2003-01-11 Thread Paul DuBois
At 14:41 +0100 1/10/03, Damir Dezeljin wrote: Hi. I want to calculate how many rows my query which uses 'GROUP BY' returns. The query: SELECT something FROM test WHERE (kid=1) OR (kid=2) OR (kid=4) GROUP BY cid,aid; Is it posible to get number of rows with such a query

Re: QUERY question (group by) - please help

2003-01-11 Thread Damir Dezeljin
SELECT something FROM test WHERE (kid=1) OR (kid=2) OR (kid=4) GROUP BY cid,aid; Is it posible to get number of rows with such a query from MySQL v3.23.49? You want both a list of rows, and a count of the number of rows -- with a single query. That doesn't make

Re: QUERY question (group by) - please help

2003-01-11 Thread Joseph Bueno
Damir Dezeljin wrote: SELECT something FROM test WHERE (kid=1) OR (kid=2) OR (kid=4) GROUP BY cid,aid; Is it posible to get number of rows with such a query from MySQL v3.23.49? You want both a list of rows, and a count of the number of rows -- with a single query. That

Re: QUERY question (group by) - please help

2003-01-11 Thread Damir Dezeljin
Hi again ;) SELECT COUNT(*) FROM test WHERE (kid=1) OR (kid=2) OR (kid=4) GROUP BY cid,aid; This query returns: +--+ | COUNT(*) | +--+ |1 | |1 | |2 | |1 | |1 | |1 | +--+ 6 rows in set (0.03 sec) Inest of this I

Re: QUERY question (group by) - please help

2003-01-11 Thread Joseph Bueno
Damir Dezeljin wrote: Hi again ;) SELECT COUNT(*) FROM test WHERE (kid=1) OR (kid=2) OR (kid=4) GROUP BY cid,aid; This query returns: +--+ | COUNT(*) | +--+ |1 | |1 | |2 | |1 | |1 | |1 | +--+ 6 rows in

QUERY question (group by) - please help

2003-01-10 Thread Damir Dezeljin
Hi. I want to calculate how many rows my query which uses 'GROUP BY' returns. The query: SELECT something FROM test WHERE (kid=1) OR (kid=2) OR (kid=4) GROUP BY cid,aid; Is it posible to get number of rows with such a query from MySQL v3.23.49? If it isn't posible ... is

QUERY question (group by) - please help

2003-01-10 Thread Damir Dezeljin
Sorry if this mail already arived to the list (I'm not sure if my posting was sucesfull, because I had problems with my mail server). The past posting: Hi. I want to calculate how many rows my query which uses 'GROUP BY' returns. The query: SELECT something FROM test WHERE (kid=1)

GROUP BY - CONCAT query question?

2002-11-08 Thread Shyamal Banerjee
Hi, You can try the following. Store the result of your query into a temporary table, say tp, with two columns tc (ticketID) and pname (pipelineName). Run the following query : select concat(select @c:='';,select tc, (@c:=concat_ws(,,@c,pname)) as x, length(@c) from tp where tc=, tc, order by

GROUP BY - CONCAT query question?

2002-11-06 Thread mysql
Hi all. 3 tables. Ticket Pipeline_Dept, and Ticket_Matrix. Ticket_Matrix matches tickets to pipeline depts. A ticket can be posted to multiple pipeline depts. I want to select all tickets and the pipeline departments they are posted to but only one row per ticket. So: SELECT

query question

2002-10-16 Thread Kevin
Hello, I have a table with a list of names. I need to get a distinct list of the names by first letter, as follows: John Mary Mark Tom the query should return the following: J M T Is there any way to this with a single query? TIA -Kevin [EMAIL PROTECTED]

Re: query question

2002-10-16 Thread Dan Goodes
Hi, Try SELECT distinct substring(name, 1, 1) from names; That should work :) -Dan On Wed, 16 Oct 2002, Kevin wrote: Hello, I have a table with a list of names. I need to get a distinct list of the names by first letter, as follows: John Mary Mark Tom the query should return

Re: query question

2002-10-16 Thread kayamboo
SELECT DISTINCT FILEDNAME FROM TABLENAME ORDER BY FIELDNAME ASC ; - Original Message - From: Kevin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 2:40 PM Subject: query question Hello, I have a table with a list of names. I need to get a distinct list

Re: query question

2002-10-16 Thread kayamboo
Hope this will work for u select distinct substring(name, 1,1) from test1 order by name asc ; - Original Message - From: Kevin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 17, 2002 2:40 PM Subject: query question Hello, I have a table with a list of names. I need

query question

2002-10-14 Thread Veysel Harun Sahin
Hello list, I am using mysql 3.23.52. I have to query one of my tables which has two columns with the type of date and time. For example i have to get the records whose date are 2002-10-12 and time is bigger than 11:30:00 and also the records whose date are 2002-10-13 and time is smaller

re: query question

2002-10-14 Thread Egor Egorov
Veysel, Monday, October 14, 2002, 12:48:58 PM, you wrote: VHS I am using mysql 3.23.52. I have to query one of my tables which has two VHS columns with the type of date and time. For example i have to get VHS the records whose date are 2002-10-12 and time is bigger than 11:30:00 VHS and also

Re: query question - solved

2002-10-14 Thread Veysel Harun Sahin
Thank you Egor. These queries meet my needs. Egor Egorov wrote: Veysel, Monday, October 14, 2002, 12:48:58 PM, you wrote: VHS I am using mysql 3.23.52. I have to query one of my tables which has two VHS columns with the type of date and time. For example i have to get VHS the records whose

Query - Question

2002-10-05 Thread Sven Schäfermeier
Hello, I have a problem concerning a SQL-Statement. In the table S_Objekt I have a field S_Kapitel (varchar (15) binary) that contains chapternumbers like 2.2., 2.2.1., 1.1., 1.2.3. ... The Query is to give me all chapternumbers of a certain hierarchy. My Idea was to ask for the number of Points

Database Query Question

2002-09-22 Thread Shaun Bramley
Hi all, I need to be able to tell what the maximum length of a char column is. Can I query the database for this information? Shaun list filter: mysql - Before posting, please check: http://www.mysql.com/manual.php (the

RE: Database Query Question

2002-09-22 Thread Andrew Braithwaite
PROTECTED]] Sent: Sunday, 22 September 2002 19:14 To: [EMAIL PROTECTED] Subject: Database Query Question Hi all, I need to be able to tell what the maximum length of a char column is. Can I query the database for this information? Shaun list filter: mysql

re: Replace query question

2002-09-20 Thread Victoria Reznichenko
speters, Thursday, September 19, 2002, 10:55:41 PM, you wrote: samdc If i use a replace query, and there isn't an error, then either samdc a new row was inserted, or an existing row was updated. samdc The primary key in the table i'm replacing to is defined as samdc mprid int not null

Replace query question

2002-09-19 Thread speters
If i use a replace query, and there isn't an error, then either a new row was inserted, or an existing row was updated. The primary key in the table i'm replacing to is defined as mprid int not null auto_increment primary key whether an insert or update actually occurs, i want to get the value

RE: simple query question

2002-09-13 Thread Meidling, Keith, CTR, OSD-C3I
I've seen a lot about 'InnoDB'. What is it? -Original Message- From: Weaver, Walt [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 4:09 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: simple query question I'd use the InnoDB table type and establish a primary

RE: simple query question

2002-09-13 Thread Iikka Meriläinen
PROTECTED]] Sent: Thursday, September 12, 2002 4:09 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: simple query question I'd use the InnoDB table type and establish a primary key/foreign key relationship (parent-child) between the two. That way referential integrity will be done

newbie query question

2002-09-12 Thread Kip Krueger
I need to query a mysql db in the following fashion ... find me all records whose column 'n' have the letters 'XY' as the first two characters. where column 'n' is just a short string to clarify ... if column 'n' has the value YR12345 don't get that record. if column 'n' has the value

Re: newbie query question

2002-09-12 Thread Jesse Sheidlower
On Thu, Sep 12, 2002 at 11:46:40AM -0700, Kip Krueger wrote: I need to query a mysql db in the following fashion ... find me all records whose column 'n' have the letters 'XY' as the first two characters. where column 'n' is just a short string to clarify ... if column 'n' has the

simple query question

2002-09-12 Thread Chris Burger
I have I hope a simple query question. I have two tables 1 One has customer id and a store id and transaction information 2 Second has a store id and store information There is multiple transactions in the first table, however there is only one record for each store id in the second

RE: simple query question

2002-09-12 Thread Weaver, Walt
: Thursday, September 12, 2002 1:57 PM To: [EMAIL PROTECTED] Subject: simple query question I have I hope a simple query question. I have two tables 1 One has customer id and a store id and transaction information 2 Second has a store id and store information There is multiple

Query Question

2002-08-19 Thread Luc Foisy
Some ficticious data ID Data1 Data2 Data3 1 1 141 1 2 5 140 1 3 4 142 1 4 3 141 1 5 2 142 1 6 5 142 1 7 7 140 1 8 2 143 1 9 3 142 1 10 3

RE: Query Question

2002-08-19 Thread Luc Foisy
I suppose I should have specified that I would not be able to filter by Data1 -Original Message- From: Mary Stickney [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 11:52 AM To: Luc Foisy Subject: RE: Query Question select * from xxx where data2 141 and data3 = 1

Re: Query Question

2002-08-19 Thread Gerald Clark
What have you tried? What did you get? Why is it not what you expected? Luc Foisy wrote: Some ficticious data ID Data1 Data2 Data3 1 1 141 1 2 5 140 1 3 4 142 1 4 3 141 1 5 2 142 1 6 5 142 1 7

RE: Query Question

2002-08-19 Thread Mary Stickney
) Subject: RE: Query Question I suppose I should have specified that I would not be able to filter by Data1 -Original Message- From: Mary Stickney [mailto:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 11:52 AM To: Luc Foisy Subject: RE: Query Question select * from xxx where

Re: Query Question

2002-08-19 Thread Keith C. Ivey
On 19 Aug 2002, at 11:32, Luc Foisy wrote: IDData1 Data2 Data3 1 1 141 1 2 5 140 1 3 4 142 1 [snip] For my return I only want a single instance of Data1, so it will most likely need be GROUP BY Data1 I would like those records to include

<    1   2   3   4   5   >