On Mon, Jun 27, 2005 at 09:15:15AM -0700, Riya Verghese wrote:
>
> I have a stmt where the outer-query is limited by the results of the
> inner query. I would like the outer query to return records in the same
> order as the values provided in the IN clause (returned form the inner
> query).
If y
I would say that you should learn a bit about relational databases
before you start working with them ;-)
All unique fields (or combinations of fields that -combined- are unique)
can serve as a primary key.
In relational databases we call them 'candidate key'.
if you have more than one candid
On Tuesday 21 Jun 2005 8:50 pm, MRB wrote:
> I'm working with a lot of data from MySQL where the MySQL ENUM type
> is used.
just a thought - it took me five years after migrating from mysql to
pg to start thinking like an sql programmer. I used to keep trying to
write stuff for pg 'like' i used
When I execute query, I've got error message.
test=> SELECT to_timestamp('00:00:05.601 SAMST Tue Jun 28 2005',
'HH24:MI:SS.MS TZ Dy Mon DD ');
ERROR: "TZ"/"tz" not supported
How can I convert '00:00:05.601 SAMST Tue Jun 28 2005' (varchar type)
to timestamp with time zone?
-
On 6/21/05, MRB <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have something in mind I'm not certain is do-able.
>
> I'm working with a lot of data from MySQL where the MySQL ENUM type is used.
>
MySQL's ENUM is basically a wrapper for CHECK. You can use a CHECK
constraint like this:
CREATE TABL
On Wed, Jun 22, 2005 at 14:56:08 +0530,
Mukesh Ghatiya <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I need to perform a query similar to
>
> SELECT table1.a.b.x table1.a.c.x from table1;
>
>
> In this case "a" is an attribute in 'table1' and is a foreign key to
> other table2 which has 'b', and 'c'
On Tue, Jun 21, 2005 at 17:20:19 +0200,
MRB <[EMAIL PROTECTED]> wrote:
>
> Here is where I get uncertain as to if this is possible. My idea is to
> create a pseudo type that triggers the creation of it's lookup tables
> the same way the SERIAL type triggers creation of a sequence and returns
On Thu, Jun 23, 2005 at 05:43:52 -0700,
[EMAIL PROTECTED] wrote:
>
> What are the major differences between Unique, primary index & just
> plain index?
>
> When creating tables I nominate one of these, but not sure what the
> difference is?
A unique key has an implied constraint that no two no
index is... an index !
UNIQUE is an index which won't allow duplicate values (except for NULLS)
PRIMARY KEY is exactly like UNIQUE NOT NULL, with the bonus that the
database knows this column is the primary key so you can use stuff like
NATURAL JOIN without telling which column you want to
Here is where I get uncertain as to if this is possible. My idea is to
create a pseudo type that triggers the creation of it's lookup tables
the same way the SERIAL type triggers creation of a sequence and returns
an int with the right default value.
Personnally I use one table which has colu
El Mar 28 Jun 2005 13:58, PFC escribió:
>
> >> Here is where I get uncertain as to if this is possible. My idea is to
> >> create a pseudo type that triggers the creation of it's lookup tables
> >> the same way the SERIAL type triggers creation of a sequence and returns
> >> an int with the right
On Tue, 2005-06-28 at 12:01, PFC wrote:
> >
> > What are the major differences between Unique, primary index & just
> > plain index?
> >
> > When creating tables I nominate one of these, but not sure what the
> > difference is?
> index is... an index !
>
> UNIQUE is an index which won't allow du
On Tue, 2005-06-28 at 13:22, Martín Marqués wrote:
> El Mar 28 Jun 2005 13:58, PFC escribió:
> >
> > >> Here is where I get uncertain as to if this is possible. My idea is to
> > >> create a pseudo type that triggers the creation of it's lookup tables
> > >> the same way the SERIAL type triggers c
Martín Marqués wrote:
I personally think that the ENUM data type is for databases that are not well
designed. So, if you see the need for ENUM, that means you need to re-think
your data design.
You mean like all those instances in the PostgreSQL system catalogs
where character(1) has been
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
>>> The goal of my query is: given a book, what did other people who
>>> bought this book also buy? I plan the list the 5 most popular such
>>> books.
>
> SELECT b.product_id, sum(quantity) as rank FROM ordered_products a,
> ordered_products b WHER
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
> when I say
> select * from table where id IN (2003,1342,799, 1450)
> I would like the records to be ordered as 2003, 1342, 799, 1450.
Just say:
select * from table where id IN (2003,1342,799, 1450) ORDER BY id;
If that doesn't work, you will hav
16 matches
Mail list logo