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: delete row
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
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
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
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
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 +
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
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 +
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
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 MySQL
- Original Message -
From: Rick Dwyer [EMAIL PROTECTED]
To: mysql@lists.mysql.com
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
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
- Original Message -
From: Rick Dwyer [EMAIL PROTECTED]
To: mysql@lists.mysql.com
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. Because the phone number is often
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 what I am
SELECT LENGTH('text');
- 4
Mikhail Berman
-Original Message-
From: Peter Brawley [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 17, 2005 1:51 PM
To: Rick Dwyer
Cc: mysql@lists.mysql.com
Subject: Re: A bit of SQL help for a MySQL novice.
Rick
I need to read the first 4
making
it go faster.
Rhino
- Original Message -
From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Friday, November 04, 2005 12:28 AM
Subject: SQL help for qty Sold YTD...
I cannot figure this one out. I have a Category table with 50,000
records, an Inventory table with over 2 million
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
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
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
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
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
[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]
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 tablename
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(GiftKey) =
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
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:
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 = 108 and Items.Active = 1;
gives
'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: mysql@lists.mysql.com
Subject: SQL help
Can someone help me
' 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 this?
this statement
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 anything
=
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 aborted
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
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
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
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
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 |
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 Help
Hi,
Need a SQL/Design help.
I have a table
Hi!
I got a table, champions, looking like this:
idclass winner_1 winner_2 year
-
0 hd carl mattias 1957
1 hs daniel
:[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 winner_2 year
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
Hi!
I got a table, champions, looking like this:
id class winner_1 winner_2 year
-
0 hd carl mattias 1957
1 hs
Hello!
I got a table, champions, looking like this:
id winner_1 winner_2
0carl mattias
1daniel carl
2erik
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
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: [EMAIL PROTECTED]
Sent
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
Carl Schéle, IT, Posten wrote:
I got a table, champions, looking like this:
id winner_1 winner_2
0carl mattias
1daniel carl
2
. 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, champions, looking like
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
* 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
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
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
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
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
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
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]
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
---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 figure out how do to this. What I have
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
.
---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 figure out how do to this. What I have
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
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 do to
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 only group things in the
priority/task/whatever but that still leaves options for duplicate
resources. Yes
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 only group things
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
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, wonder if the sql gurus can help
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
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,
. 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 have a related record in
a second table. What I think I need is a subselect, but since
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
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 -
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
* 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
- 1 - 20
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 Help Needed
* Dave
I have 2 tables
Users (UserID
* 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 I
What the hell this query do!?
SELECT student.name FROM student
WHERE not exists(
SELECT *
FROM enrollment
WHERE not exists(
SELECT *
FROM class
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
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 this throttling script is a
PERL
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, subject from
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
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,
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, for
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 give me a
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
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 date2
: 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 111
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 describe mytable;
+---+--+--+-+-+---+
| Field
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 plz
Sorry, I meant:
mysql select name,max(dateq
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
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
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 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 randomly select 5 records from a table
the above 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: [EMAIL PROTECTED]
Sent: Wednesday, May 09, 2001 11:38 AM
Subject: SQL
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:27 PM
Subject: Re: SQL help
i dont follow step #3.
At 11:42 PM 5/8
.
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 randomly select 5
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
* is
"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,
97 matches
Mail list logo