|
Posted by Astra on 11/15/90 11:31
Many thanks guys
Apologies for multi-post.
Rgds Robbie
"Erland Sommarskog" <esquel@sommarskog.se> wrote in message
news:Xns9707F156E1626Yazorman@127.0.0.1...
Astra (No@Spam.com) writes:
> I would like
>
> cat01 <nothing> << ditto
> cat03 cat01
> cat05 cat01
> cat02 <nothing>
> cat06 cat02
> cat04 <nothing>
> cat07 cat04
>
> Do you know if this is possible in pure SQL (I must confess that I'm using
> MySQL, but I would have thought the SQL syntax would be the same if it is
> possible) or a combo of ASP & SQL?
I believe this query would work in SQL Server:
SELECT CATID, LEVEL
FROM STOCKCATS
ORDER BY coalesce(LEVEL, CATID), LEVEL
But I don't think it this conforms to ANSI standards, so it may not run
in MySQL.
If you want help with MySQL, you are probably better off asking in
comp.databases.mysql or some other MySQL forum.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Navigation:
[Reply to this message]
|