n two
tables, you should not define several ON UPDATE CASCADE clauses that act
on the same column in the parent table or in the child table."
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 20 February 2008 12:44
To: mysql@lists.mysql.com
Subject: sql help:
Say I have two tables:
table_a
--
a_id (primary key)
b_id
table_b
--
b_id (primary key)
name
there is a one to many mapping between rows in table b and rows in
table a.
Say I had an Id of a row in table a an (a_id, say 5). Now, what I
want to do is delete the row in table_a (ea
Mark, is the 'secs' column the offset from the minimum value of the
timestamp column?
If so, you might try something like this:
SELECT UNIX_TIMESTAMP(MIN(timestamp)) INTO @min_timestamp FROM my_table;
SELECT uid, timestamp,
UNIX_TIMESTAMP(timestamp) - @min_timestamp AS secs
FROM my_table
ORDER B
Hi All
I have the following data example
UID Timestamp
123456 20071201 12:00:01
123456 20071201 12:00:06
987654 20071201 12:00:01
987654 20071201 12:00:09
etc
I need :
UID Timestamp secs
123456 20071201 12:00:01 000
I have a need to output a recordset that shows the record with the
higest value for severity within a date range. That is easy enough, but,
in the same query, I need to show that data 3 times in the same query.
Once where event_avail = 1, then again where event_perf = 1 and finally
where even_sec =
m i l e s wrote:
Hi,
I have the following Query and Im a lil lost on this one
SELECT DISTINCT tbe_orders.order_id, tbe_orders.order_date,
tbe_orders.order_piececount
FROM tbe_orders
The query produces the following results:
+++
+ order_id +
At 18:51 9.7.2006, you wrote:
Hi,
I have the following Query and Im a lil lost on this one
SELECT DISTINCT tbe_orders.order_id, tbe_orders.order_date,
tbe_orders.order_piececount
FROM tbe_orders
SELECT tbe_orders.order_id,
tbe_orders.order_date, sum(tbe_orders.order_piececount)
FROM t
Hi,
I have the following Query and Im a lil lost on this one
SELECT DISTINCT tbe_orders.order_id, tbe_orders.order_date,
tbe_orders.order_piececount
FROM tbe_orders
The query produces the following results:
+++
+ order_id + order_date + ord
H(str)
Returns the length of the string str, measured in bytes. A multi-byte
character counts as multiple bytes. This means that for a string
containing five two-byte characters, LENGTH() returns 10, whereas
CHAR_LENGTH() returns 5.
mysql> SELECT LENGTH('text');
-> 4
Mikhail Berm
Rick
>I need to read the first 4 positions in the phone number to determine
it's location.
>My statement looks like this:
>'Select mid(phone, 1,4) as phoneareacode from phonetable'
>This works but if the number is entered as 1(203)-555-1212 the above
would return "1(20" which is not >wha
way to get that
area code.
Rhino
- Original Message -
From: "Rick Dwyer" <[EMAIL PROTECTED]>
To:
Sent: Thursday, November 17, 2005 11:53 AM
Subject: Re: A bit of SQL help for a MySQL novice.
Unfortunately, the phone numbers come from text logs that get imported
into mysql.
10:28 AM
Subject: A bit of SQL help for a MySQL novice.
Hello All.
I am hoping for a bit of help with some code that has really given
me some trouble. If this is not he correct forum for this any
help in pointing me to a more suited list would be appreciated.
I have a MySQL 4.1.x dat
- Original Message -
From: "Rick Dwyer" <[EMAIL PROTECTED]>
To:
Sent: Thursday, November 17, 2005 10:28 AM
Subject: A bit of SQL help for a MySQL novice.
Hello All.
I am hoping for a bit of help with some code that has really given me
some trouble. If this i
Rick Dwyer <[EMAIL PROTECTED]> wrote on 11/17/2005 10:28:51 AM:
> Hello All.
>
> I am hoping for a bit of help with some code that has really given me
> some trouble. If this is not he correct forum for this any help in
> pointing me to a more suited list would be appreciated.
>
> I have a My
Hello All.
I am hoping for a bit of help with some code that has really given me
some trouble. If this is not he correct forum for this any help in
pointing me to a more suited list would be appreciated.
I have a MySQL 4.1.x database containing records with phone numbers.
Most of the phon
I would first try refactoring your SQL to use INNER JOIN statements
instead of the comma separated lists you are currently using. I would also
not use any subqueries. Test this and see if it works for you:
SELECT SUM(li.quantity) as qtysoldytd
FROM LineItem li
INNER JOIN Sales sa
on li
should be
directed toward getting the query running correctly, THEN worry about making
it go faster.
Rhino
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Friday, November 04, 2005 12:28 AM
Subject: SQL help for qty Sold YTD...
> I cannot figure this one out. I have
I cannot figure this one out. I have a Category table with 50,000
records, an Inventory table with over 2 million records. A Sales table
with 500,000 records. And a LineItem table with 800,000 records pairing
the Inventory ID with the Sales Transaction ID and Quantity. I need to
generate a Quantity
m i l e s wrote:
Hi,
I have an odd situation where I was handed just bad data, and while I
have cleaned it up to the best of my ability one hurdle remains.
I have a situation where I have the following example in a field:
Canna ÒBengalÒ.
Note the odd chrs "Ò" in the field ? I need to g
Hi,
I have an odd situation where I was handed just bad data, and while I
have cleaned it up to the best of my ability one hurdle remains.
I have a situation where I have the following example in a field:
Canna ÒBengalÒ.
Note the odd chrs "Ò" in the field ? I need to get rid of those, my
Darryl,
>Unfortunately the item field has got data with quotes around it.
IE
>"KP-00310". I need to clean up the data and have the field contain
>just KP-00310. Since I have 10,000 records, I need a update
>statement or something to clean that up.
To remove all double quotes: UPDATE tablena
[snip]
Unfortunately the item field has got data with quotes around it. IE
"KP-00310". I
need to clean up the data and have the field contain just KP-00310.
Since I
have
10,000 records, I need a update statement or something to clean that up.
Any ideas ?
[/snip]
http://dev.mysql.com/doc/mysql/en
Greetings,
I have a table in my database called item. It has two fields: item and
description.
Unfortunately the item field has got data with quotes around it. IE
"KP-00310". I
need to clean up the data and have the field contain just KP-00310. Since I
have
10,000 records, I need a update state
On 6/26/05, 2wsxdr5 wrote:
> Can someone tell me why this query works...
> SELECT UserKey
> FROM(
> SELECT UserKey, Count(GiftKey) Gifts
> FROM Gift
> Group BY UserKey
> ) GC
> WHERE GC.Gifts >= 3
Why this construction and not simply:
SELECT UserKey
FROM Gift
GROUP BY UserKey
HAVING Count(Gi
Can someone tell me why this query works...
SELECT UserKey
FROM(
SELECT UserKey, Count(GiftKey) Gifts
FROM Gift
Group BY UserKey
) GC
WHERE GC.Gifts >= 3
And this one doesn't?
SELECT UserKey, UserID,
FROM User
WHERE UserKey IN
(SELECT UserKey
FROM(
SELECT UserKey, Count(GiftKey) Gifts
In article <[EMAIL PROTECTED]>,
"Rob Brooks" <[EMAIL PROTECTED]> writes:
> The only difference in the 2 statements is the 'where items_online.ID =
> NULL' part.
> Clearly in the first set, items_online.ID = NULL in record 7047 ...
Nope. items_online.ID IS NULL for that record, but comparing anyt
but in
the record which starts with the name 'Triad'
also ... I'm using 4.0.20-standard-log
-Original Message-
From: Rob Brooks [mailto:[EMAIL PROTECTED]
Sent: Monday, February 28, 2005 2:56 PM
To: mysql@lists.mysql.com
Subject: SQL help
Can someone help me with thi
is not in record '7047' but in
> the record which starts with the name 'Triad'
>
> also ... I'm using 4.0.20-standard-log
>
> -Original Message-
> From: Rob Brooks [mailto:[EMAIL PROTECTED]
> Sent: Monday, February 28, 2005 2:56 PM
> To: mysq
l@lists.mysql.com
Subject: SQL help
Can someone help me with this?
this statement:
select Items.Name, Items.Detail, Items.ID, items_online.ID from Items left
join items_online on items_online.ItemKey = Items.ID where (Name regexp
'ad') and AccountKey = 10
Can someone help me with this?
this statement:
select Items.Name, Items.Detail, Items.ID, items_online.ID from Items left
join items_online on items_online.ItemKey = Items.ID where (Name regexp
'ad') and AccountKey = 108 and Items.Active = 1;
gives this:
+---+--
I could not get the subquery to work, but the sql below did what I
wanted:^)
SELECT balloon_rec.* FROM `balloon_rec` LEFT JOIN `balloon_txt` USING
(`access_no`) WHERE MATCH
(`balloon_txt`.`access_no`,`balloon_txt`.`recs_txt`) AGAINST
('meteorology')
On Sat, 17 Jul 2004 12:15:20 -0400, "leegold"
I tried what's below, seemed OK, so I replaced an "IN" for the "=" in
the subquery below because of the subquery's error message. I thought
w/"IN" I'd get three (3) records returned as expected. But when I tried
"IN" I got my entire DB returned - I don't show that below - it kept
scrolling so I ab
Bob Lockie <[EMAIL PROTECTED]> wrote:
> What I really want was
> mysql> update records set records.prio=2 where records.in=(select
> records.id from records, audit_log, audit_log_records where
> audit_log.tracker_id=audit_log_records.tracker_id and
> records.id=audit_log_records.id and audit_log
Bob Lockie wrote:
What I really want was
mysql> update records set records.prio=2 where records.in=(select
records.id from records, audit_log, audit_log_records where
audit_log.tracker_id=audit_log_records.tracker_id and
records.id=audit_log_records.id and audit_log.operation='D' and
audit_log.
What I really want was
mysql> update records set records.prio=2 where records.in=(select
records.id from records, audit_log, audit_log_records where
audit_log.tracker_id=audit_log_records.tracker_id and
records.id=audit_log_records.id and audit_log.operation='D' and
audit_log.completed is null)
fferent modes supported by the week() function and make sure you pick the
one that matches the rules in your environment.
Rhino
- Original Message -
From: "Ramesh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 01, 2004 11:12 PM
Subject: MySql SQL H
Hi,
Need a SQL/Design help.
I have a table as follows:
ORDER_HISTORY
--
ORDER_ID | ORDER_NAME | ORDER_AMOUNT | ORDER_DATE
--
10 | Order 1| 20.00| 10-Jan-2003
11 | Order 2| 200.00 | 15-Jan-20
Carl Schéle, IT, Posten wrote:
Hi!
I got a table, champions, looking like this:
idclass winner_1 winner_2 year
-
0 hd carl mattias 1957
1
: Carl Schéle, IT, Posten [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 19, 2004 6:50 PM
To: [EMAIL PROTECTED]
Subject: SQL-help needed
Hi!
I got a table, champions, looking like this:
idclass winner_1
Hi!
I got a table, champions, looking like this:
idclass winner_1 winner_2 year
-
0 hd carl mattias 1957
1 hs daniel
Hi!
I got a table, champions, looking like this:
id class winner_1 winner_2 year
-
0 hd carl mattias 1957
1 hs daniel
sions. But it's cheap :)
/Carl
-Ursprungligt meddelande-
Från: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Skickat: den 17 februari 2004 16:44
Till: Carl Schéle, IT, Posten
Kopia: [EMAIL PROTECTED]
Ämne: Re: SQL-HELP
Carl Schéle, IT, Posten wrote:
>
> I got a table, champio
Carl Schéle, IT, Posten wrote:
I got a table, champions, looking like this:
id winner_1 winner_2
0carl mattias
1daniel carl
2er
Now UNION is implemented in MySQL 4.0.0. and as I stated earlier I run 3.23.58.
-Ursprungligt meddelande-
Från: Rodolphe Toots [mailto:[EMAIL PROTECTED]
Skickat: den 17 februari 2004 16:19
Till: Jonas Lindén; Carl Schéle; [EMAIL PROTECTED]
Ämne: SV: SQL-HELP
yeah
but that wont really do
februari 2004 16:01
Till: Carl Schéle; IT; Posten; [EMAIL PROTECTED]
Ämne: Re: SQL-HELP
Hello, you might want to try select DISTINCT ?
http://www.mysqlfreaks.com/statements/18.php
/Jonas
- Original Message -
From: "Carl Schéle, IT, Posten" <[EMAIL PROTECTED]>
To: &
Hello, you might want to try select DISTINCT ?
http://www.mysqlfreaks.com/statements/18.php
/Jonas
- Original Message -
From: "Carl Schéle, IT, Posten" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 17, 2004 3:49 PM
Subject: SQL-HELP
Hello!
I got a table, champions, looking like this:
id winner_1 winner_2
0carl mattias
1daniel carl
2erik
Gerald,
Your right. You and Roger hit it on the head. Stupid me miss read
Roger's original post.
Last night I was banging my head on the left and right joins but I
didn't understand it until I read Gerald's last note. Plus I didn't
realize you can put two conditions in the ON clause which is w
That is the whole point of a left join.
It joins to a null record when the appropriate right record does not exist.
sulewski wrote:
Roger,
Thank you for the feedback. But unfortunately this doesn't work. The
problem is that rid will never be null. I'm trying to find the item in
tab1 where a lin
Roger,
In regards to my last e-mail what would be great is if I can get all
the records in tab1 then subtract from there all the records that match
the query tab1.id=tab2.rid and tab2.vid=46. The result would give me
what I need but alas mysql doesn't support minus.
Joe
On Friday, January 16,
Roger,
Thank you for the feedback. But unfortunately this doesn't work. The
problem is that rid will never be null. I'm trying to find the item in
tab1 where a link cannot be created in tab2 where tab2.rid=tab1.id and
tab2.vid=46 because there is no record in tab2. Not that the record may
have
* sulewski
[...]
> What I need is all records in table 1 that will
> not link to table 2 such that relid=rid and vid=46
Sounds like a job for LEFT JOIN...?
Join to the rows you do NOT want with a left join, and put as a condition in
the WHERE clause that a joined column IS NULL. Something like th
Hello,
Hopefully you sql guru's can help me out a bit. :)
Here is the short example of what I want to accomplish. I wish to
have the difference between two different select queries.
So if one query pulls records 1,2,3 and 4 and the second pulls records
1 and 4 I wish to have only the records 2 a
SQL guru's,
I could use some help writing a bit of SQL.
There's 3 tables:
orderable_parts
partID varchar,
topCatID int, # top level category ID
...
part_attributes
partID varchar,
attName varchar,
attValue varchar,
...
topcatattributevalues
tcavID int,
topCatID int,
attName varchar,
attValue varc
Estoy tomando el sol
.
q
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Estoy tomando el sol
.
q
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
d then apply the max
> function
> to the integer values to get correct results.
>
> Best regards,
>
> Lin
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 24, 2003 4:41 PM
> To: Dathan Vance Pattisha
age-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 24, 2003 4:41 PM
To: Dathan Vance Pattishall
Cc: [EMAIL PROTECTED]
Subject: RE: SQL Help...
I looked at the group by option already and I dont think it will do what I
need it to do. I say this because it will on
That works great. =D
Knew it shouldn't be that difficult, thanks a bunch.
And it actually works with the Priorities being in text form to (low, med,
hi).
-Nick
> At 02:52 PM 7/24/2003, you wrote:
>>After some searching around different books/manuals/google I still can't
>>seem to figure out how d
Try:
select task, resource, department, max(priority)
from table
group by task, resource, department
Regards,
Ulises
-Mensaje original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Enviado el: Jueves 24 de Julio de 2003 02:53 PM
Para: [EMAIL PROTECTED]
Asunto: SQL Help...
After
.
> -->-Original Message-
> -->From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> -->Sent: Thursday, July 24, 2003 12:53 PM
> -->To: [EMAIL PROTECTED]
> -->Subject: SQL Help...
> -->
> -->After some searching around different books/manuals/google I still
>
At 02:52 PM 7/24/2003, you wrote:
After some searching around different books/manuals/google I still can't
seem to figure out how do to this. What I have is a table with 4 cols
(task, resource, department, priority) and what I want to do is be able to
select distinct resources and list what their h
-->-Original Message-
-->From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
-->Sent: Thursday, July 24, 2003 12:53 PM
-->To: [EMAIL PROTECTED]
-->Subject: SQL Help...
-->
-->After some searching around different books/manuals/google I still
can't
-->seem to fi
After some searching around different books/manuals/google I still can't
seem to figure out how do to this. What I have is a table with 4 cols
(task, resource, department, priority) and what I want to do is be able to
select distinct resources and list what their highest priority is.
In other words
You want to look at 'group by acctSrv.accountID' rather than a compound
select.
On Mon, 23 Dec 2002, Adam Nowalsky wrote:
> Date: Mon, 23 Dec 2002 09:04:32 -0500
> From: Adam Nowalsky <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: sql help
>
> hi, won
hi, wonder if the sql gurus can help with this one. i have two tables
(simplified), tblAccounts and tblAccountsServices. tblAccounts has an ID
(PK) and an accountNumber, and tblAccountsServices has an ID (PK) and
accountID (FK to tblAccounts.ID). i want to run a query that gives me a row
for eac
btw, regarding my last post, i'm running mysql 3.23.53-max-nt...
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-
hi, wonder if the sql gurus can help with this one. i have two tables
(simplified), tblAccounts and tblAccountsServices. tblAccounts has an ID
(PK) and an accountNumber, and tblAccountsServices has an ID (PK) and
accountID (FK to tblAccounts.ID). i want to run a query that gives me a row
for eac
mailto:[EMAIL PROTECTED]]
>Gesendet: Dienstag, 10. September 2002 22:40
>An: [EMAIL PROTECTED]
>Betreff: SQL help, search with related record in 2nd table
>
>
>I am looking for some help on a SQL query to perform a search, but
>constrain the search to those records which
I am looking for some help on a SQL query to perform a search, but
constrain the search to those records which have a related record in
a second table. What I think I need is a subselect, but since this is
not possible in 3.23.47, I am looking for work around.
I have one table for Visitors (ke
* Dave
> Thanks for your responses but it's not that much help I need with
> my SQL ;-)
>
> None of the 3 suggestions work.
>
> Please look at the examples I gave. I need *all* UserIDs regardless of
> whether they have a record in History that matches both UserID and WeekID.
...and that is what
only exist for WeekID = 2, other for 1 and
2 and so on.
Cheers
Dave
- Original Message -
From: "Roger Baklund" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Dave" <[EMAIL PROTECTED]>
Sent: Thursday, May 23, 2002 6:21 PM
Subject: RE: SQL
SELECT UserID, WeekID, SUM(Points) AS WeeklyPoints FROM History GROUP BY
WeekID;
Gurhan
-Original Message-
From: Dave [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 23, 2002 9:37 AM
To: [EMAIL PROTECTED]
Subject: SQL Help Needed
I have 2 tables
Users (UserID)
History (UserID
* Dave
> I have 2 tables
>
> Users (UserID)
>
> History (UserID, WeekID, Points)
>
> When a User record is created a record is inserted into History with the
> current WeekID, so for example data could be :
>
> Users
>
>
>
>
>
>
> History
> --
> - 1 - 10
>
Ok this should be easy so I'm prolly going to screw it up, but here goes =D
Your query should be:
SELECT UserID, SUM(points) FROM History WHERE WeekID = 'whatever' GROUP BY
UserIdI think that should do it. Someone yell if its wrong though.
-Nick
> I have 2 tables
>
> Users (UserID)
>
> History
I have 2 tables
Users (UserID)
History (UserID, WeekID, Points)
When a User record is created a record is inserted into History with the
current WeekID, so for example data could be :
Users
History
--
- 1 - 10
- 1 - 20
- 1 - 30
- 2 - 40
What the hell this query do!?
SELECT student.name FROM student
WHERE not exists(
SELECT *
FROM enrollment
WHERE not exists(
SELECT *
FROM class
Hi Viraj,
You can do it using temporary table.
Create temporary table tmp select subject from outgoing where auth='USER'
order by timestamp desc limit 50;
Select count(distinct subject) from tmp group by subject;
drop table tmp;
If the result of the second query is 1 all the last 50 messages h
re cups
of coffee:)
-Original Message-
From: Dan Vande More [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 17, 2002 1:44 PM
To: [EMAIL PROTECTED]
Subject: RE: sql help examining log table
I might be wrong, but this may get you going in the right direction:
select count(subject) as count, su
day, March 17, 2002 1:35 PM
To: [EMAIL PROTECTED]
Subject: sql help examining log table
Hello,
We use mysql to store outgoing email headers from our users and do
throttling
on users that appear to be spamming based on some simple queries to this
table. We use the Communigate mail server and th
Hello,
We use mysql to store outgoing email headers from our users and do throttling
on users that appear to be spamming based on some simple queries to this
table. We use the Communigate mail server and this throttling script is a PERL
program implemented as a content filter. More information is
Hi,
At 11:21 AM 14/02/2002 -0500, you wrote:
>On Thursday 14 February 2002 07:58, Carl Shelbourne wrote:
> > Hi
> >
> > I am trying to write an auction script that uses mysql as its backend. Each
> > auction can have upto 25 sub auctions(cells) taking place.
> >
> > I'm trying to query the DB to
On Thursday 14 February 2002 07:58, Carl Shelbourne wrote:
> Hi
>
> I am trying to write an auction script that uses mysql as its backend. Each
> auction can have upto 25 sub auctions(cells) taking place.
>
> I'm trying to query the DB to give me a list of all the successfull bids
> for each cell,
Hi
I am trying to write an auction script that uses mysql as its backend. Each
auction can have upto 25 sub auctions(cells) taking place.
I'm trying to query the DB to give me a list of all the successfull bids
for each cell, for each auction...
SELECT b.auctionId, b.cellId, MAX(b.bid) as bid,
Try this:
select key_col, min(name), max(date_col)
from my_table
group by key_col ;
You could use max(name) instead of min(name) also, although
since the names can be misspelled, I don't see why it would matter
which name is displayed.
s.s.
On Wed, 30 Jan 2002 21:36:04
Further, I'd advise NOT using field names like "date" and "key". Using
eserved words is never a good prcatice.
-Original Message-
From: Rick Emery
Sent: Wednesday, January 30, 2002 2:16 PM
To: 'P.Agenbag'; 'mysql'
Subject: RE: SQL help
Sorry, I meant:
mysql> select name,max(dateq) from mytable group by keyq;
-Original Message-
From: Rick Emery
Sent: Wednesday, January 30, 2002 2:14 PM
To: 'P.Agenbag'; mysql
Subject: RE: SQL help plz
mysql>
ent: Wednesday, January 30, 2002 1:36 PM
To: mysql
Subject: SQL help plz
Hi
I need help with an sql string:
have a table similar to this:
idkeynamedate
1 123name1 date1
2 123name1 date2
3 111name2 date1
4
At 21:36 +0200 1/30/02, P.Agenbag wrote:
>Hi
>I need help with an sql string:
>
>have a table similar to this:
>
>idkeynamedate
>1 123name1 date1
>2 123name1 date2
>3 111name2 date1
>4 111name2
Hi
I need help with an sql string:
have a table similar to this:
idkeynamedate
1 123name1 date1
2 123name1 date2
3 111name2 date1
4 111name2 date2
5 123name1 date3
Now
ve resultset, program to draw whatever number of records you
> >want.
> >3) submit the query, select * from it where id in (your random record ids);
> >
> >
> >- Original Message -
> >From: "Webmaster" <[EMAIL PROTECTED]>
> >To: <
t;
rand() seems using primary key of your table.
mine works in both old and new versions.
- Original Message -
From: "Webmaster" <[EMAIL PROTECTED]>
To: "Tony Shiu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, May 09, 2001 12
<[EMAIL PROTECTED]>
>Sent: Wednesday, May 09, 2001 11:38 AM
>Subject: SQL help
>
>
>> How do I write SQL in MySQL to randomly select 5 records from a table?
>>
>>
>> -
&
want.
3) submit the query, select * from it where id in (your random record ids);
- Original Message -
From: "Webmaster" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, May 09, 2001 11:38 AM
Subject: SQL help
> How do I write SQL in MySQL to randoml
SELECT * FROM db ORDER BY rand() LIMIT 5
--zak
- Original Message -
From: "Webmaster" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, May 08, 2001 9:38 PM
Subject: SQL help
> How do I write SQL in MySQL to randomly sele
How do I write SQL in MySQL to randomly select 5 records from a table?
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this th
Cindy writes:
>SELECT *.DATE_FORMAT(datefield, "%M %d, %Y") FROM table;
Agh. *,DATE of course. Comma, not dot.
--Cindy
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysq
"j.urban" writes:
>select field1,field2,DATE_FORMAT(datefield,"%M %d, %Y"),field4,fieldn from
>table;
He didn't want to have to explicitly list all 40 other fields, though.
Can't he do something like
SELECT *.DATE_FORMAT(datefield, "%M %d, %Y") FROM table;
? That gives him one extra field,
select *,DATE_FORMAT(datecolumn,'%M %D %Y');
On Tue, 16 Jan 2001, Mike Podlesny wrote:
>
> > Thanks for your help but that unfortunately doesn't answer the question,
> > unless I am looking at it wrong. I want the sql statement to read
> something
> > to the affect:
> >
> > SELECT * FROM Table
Mike Podlesny wrote:
>
> I want to select all the fields in from the mySQL database except I want my
> date field to be returned in the format of:
>
> January 16, 2001
>
> How can this be done without having to do the select in this manner:
>
> SELECT field1,field2,MONTHNAME(datefield),DA
1 - 100 of 106 matches
Mail list logo