If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > need help in select statement

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-24-06, 05:02
kahwinlee kahwinlee is offline
Registered User
 
Join Date: May 2006
Posts: 1
need help in select statement

i wish to generate a sql which is not related to any table and can show the following result with two parameter 1997 and 2000:

--------
| year |
--------
| 1997 |
| 1998 |
| 1999 |
| 2000 |
--------
Reply With Quote
  #2 (permalink)  
Old 05-24-06, 07:34
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
Code:
select 1997 as year
union all
select 1998
union all
select 1999
union all
select 2000
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On