Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 1st, 2003, 09:16 AM
loudo loudo is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 10 loudo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question SELECT something FROM (SELECT something2 FROM ...) ...

Hi!
I would like to ask you for help. Working with Oracle I used to create selects like this :

SELECT a.x, b.y FROM my_table_1 a , my_table_2 b WHERE ...

This works perfectly in Firebird, too. BUT Firebird stops working in this case (only a little difference) :

SELECT a.x, b.y FROM my_table_1 a , (SELECT something from my_table_2) b WHERE ...


What can be the problem?
Thank you.

Reply With Quote
  #2  
Old August 3rd, 2003, 07:08 PM
jpenn's Avatar
jpenn jpenn is offline
Contributing User
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2002
Location: Washington, DC
Posts: 2,693 jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level)jpenn User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 5 h 41 m 10 sec
Reputation Power: 16
It appears that your statement is wrong, sub queries look like something simular to this:
Code:
SELECT column,column,etc FROM table_one WHERE ( SELECT AVG(column) FROM table_two ) < column

Not sure if that is what you are looking for.
__________________
~ Joe Penn

Last edited by jpenn : August 3rd, 2003 at 07:10 PM.

Reply With Quote
  #3  
Old August 10th, 2003, 03:16 AM
dunarel dunarel is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Location: Bucharest, Romania
Posts: 5 dunarel User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally posted by jpenn
It appears that your statement is wrong


Trere is nothing wrong with
SELECT a.x, b.y FROM my_table_1 a , (SELECT something from my_table_2) b WHERE ...

I encountered the same problem comming from Oracle too.
Seems Firebird does not support such serialization of SQL.
This feature is very usefull as it is capable of serializing sql operations.

The only workaround I found is by making succesive views.
Very dificult to read and useless load of the dictionary.

I hope it will be implemented in version 2.

It is something like the WITH clause of the SQL99 standard.

Reply With Quote
  #4  
Old August 21st, 2003, 04:27 AM
WhiteMan WhiteMan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Ukraine
Posts: 1 WhiteMan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to WhiteMan
But you can use something like this

SELECT (SELECT Name FROM table2 where table2.field1=table1.field1) from Table1

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > SELECT something FROM (SELECT something2 FROM ...) ...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway