PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > CREATE VIEW syntax for mySQL
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
CREATE VIEW syntax for mySQL

Réponse
 
LinkBack Outils de la discussion
Vieux 17/10/2007, 15h41   #1
Mukesh_Singh_Nick@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut CREATE VIEW syntax for mySQL

I am trying the ANSI SQL syntax, like in the command below, but it
raises a syntax error:

CREATE VIEW todays_expenses AS
SELECT item, amount FROM my_expenses
where date = curdate();

Three questions:

a) What's the correct syntax?

b) I am using mySQL version 4.1.22-community-nt. I can see an online
manual for the same over here:

http://dev.mysql.com/doc/refman/4.1/en/

However, I can't find a manual for mySQL specific syntax such as the
scenario described above. Can you tell me where it is?

c) What's the best book to buy for learning mySQL for a database
programmer. I'll tell you my goals. I want a book that covers:

1) the theory behind operators (cartesian JOIN, cross JOIN, all the
JOINs, UNION, UNION all) and their comparison to mathematics/set
theory

2) writing complex queries, nested queries (sub-queries)

3) tell me about some mySQL hacks like how many maximum columns a
table can have, if there's some such thing

4) explains what indexing is, types of indexing, types of locks, etc.

5) explains what database partitions are

6) explains some maintenance legwork like backup/restore, setting up
ODBC connections, creating and deleting users, granting/revoking
rights

PS: ALL OF THIS OVER WINDOWS

7) teaches me to write stored procedures, cursors, functions, packages
(if there's such a thing) and triggers

8) tells me about the limits of each datatype and possibly their
internal structure (for instance, is the DECIMAL a floating pointing
number really?)


************************************************** ***************
And, specifically that does NOT waste time covering:
************************************************** ***************
a) the tools and toys around mySQL and how to use them
b) the differences in different versions

I can get all of that stuff off the Internet easier than I can get the
stuff I want.

  Réponse avec citation
Vieux 17/10/2007, 16h27   #2
Rik Wasmus
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CREATE VIEW syntax for mySQL

On Wed, 17 Oct 2007 15:41:47 +0200, <Mukesh_Singh_Nick@yahoo.com> wrote:

> I am trying the ANSI SQL syntax, like in the command below, but it
> raises a syntax error:
>
> CREATE VIEW todays_expenses AS
> SELECT item, amount FROM my_expenses
> where date = curdate();
>
> Three questions:
>
> a) What's the correct syntax?


The above works fine here, as long as the fields exist in the table.

> b) I am using mySQL version 4.1.22-community-nt. I can see an online
> manual for the same over here:
>
> http://dev.mysql.com/doc/refman/4.1/en/
>
> However, I can't find a manual for mySQL specific syntax such as the
> scenario described above. Can you tell me where it is?


http://dev.mysql.com/doc/refman/5.0/en/views.html
"Views (including updatable views) are implemented in MySQL Server 5.0.
Views are available in binary releases from 5.0.1 and up."

And for 'MySQL specific syntax', just referring to
http://dev.mysql.com/doc/refman/4.1/en/sql-syntax.html does the trick.

So either upgrade of find another solution then a view.

> c) What's the best book to buy for learning mySQL for a database
> programmer. I'll tell you my goals. I want a book that covers:


Don't know, the SQL book I have is Joe Celko's Trees and Hierarchies book,
which is definitely not written for MySQL itself..
--
Rik Wasmus
  Réponse avec citation
Vieux 17/10/2007, 16h41   #3
Mukesh_Singh_Nick@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CREATE VIEW syntax for mySQL

On Oct 17, 3:27 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Wed, 17 Oct 2007 15:41:47 +0200, <Mukesh_Singh_N...@yahoo.com> wrote:
> > I am trying the ANSI SQL syntax, like in the command below, but it
> > raises a syntax error:

>
> > CREATE VIEW todays_expenses AS
> > SELECT item, amount FROM my_expenses
> > where date = curdate();

>
> > Three questions:

>
> > a) What's the correct syntax?

>
> The above works fine here, as long as the fields exist in the table.
>
> > b) I am using mySQL version 4.1.22-community-nt. I can see an online
> > manual for the same over here:

>
> >http://dev.mysql.com/doc/refman/4.1/en/

>
> > However, I can't find a manual for mySQL specific syntax such as the
> > scenario described above. Can you tell me where it is?

>
> http://dev.mysql.com/doc/refman/5.0/en/views.html
> "Views (including updatable views) are implemented in MySQL Server 5.0.
> Views are available in binary releases from 5.0.1 and up."
>
> And for 'MySQL specific syntax', just referring to http://dev.mysql.com/doc/refman/4.1/...yntax.htmldoes the trick.
>
> So either upgrade of find another solution then a view.
>
> > c) What's the best book to buy for learning mySQL for a database
> > programmer. I'll tell you my goals. I want a book that covers:

>
> Don't know, the SQL book I have is Joe Celko's Trees and Hierarchies book,
> which is definitely not written for MySQL itself..
> --
> Rik Wasmus





Thanks, Rik.

  Réponse avec citation
Vieux 17/10/2007, 22h15   #4
Good Man
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CREATE VIEW syntax for mySQL

Mukesh_Singh_Nick@yahoo.com wrote in news:1192628507.401151.265370
@k35g2000prh.googlegroups.com:

> Three questions:


> c) What's the best book to buy for learning mySQL for a database
> programmer. I'll tell you my goals. I want a book that covers:


May I humbly suggest Apress' "Pro MySQL":

http://www.amazon.com/MySQL-Experts-...dp/159059505X/

It covers everything right down to the nuts and bolts of things you didn't
even know you wanted to know about MySQL.

Highly, highly recommended. Too bad I haven't read it all yet.

  Réponse avec citation
Vieux 18/10/2007, 00h29   #5
Mukesh_Singh_Nick@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: CREATE VIEW syntax for mySQL

On Oct 17, 9:15 pm, Good Man <he...@letsgo.com> wrote:
> Mukesh_Singh_N...@yahoo.com wrote in news:1192628507.401151.265370
> @k35g2000prh.googlegroups.com:
>
> > Three questions:
> > c) What's the best book to buy for learning mySQL for a database
> > programmer. I'll tell you my goals. I want a book that covers:

>
> May I humbly suggest Apress' "Pro MySQL":
>
> http://www.amazon.com/MySQL-Experts-...dp/159059505X/
>
> It covers everything right down to the nuts and bolts of things you didn't
> even know you wanted to know about MySQL.
>
> Highly, highly recommended. Too bad I haven't read it all yet.





Good Man, Read the book reviews at Amazon. I'm halfway looking through
the Table of Contents at Amazon and I can't resist stopping myself to
say thanks. It seems just like one of the books I need.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h45.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14879 seconds with 13 queries