General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old June 3rd, 2012, 05:58 AM
leo_ultra_leo leo_ultra_leo is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 1 leo_ultra_leo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 17 sec
Reputation Power: 0
Post Select from two tables

Hi folks,

How can I select from two tables to get one relevant result, in other word I have two tables the first one name is (Table1), and the second's (Table2) according to the following:

Table1:

select subtype ,subtypename from table2

subtype subtypename
-------- -----------
0 Default
1 Employee
2 Test
3 Test2
4 Private
Tables2

select brands,subscriber from table2
group by brands
order by brands

brands subscriber
--------- -----------
0 29029
1 2
2 21
3 175
4 467

How can I get this result:


subtypename subscriber
----------- -------------
Default 29029
Employee 2
Test 21
Test2 175
Private 467

Because subtypename values is the same of subtype's.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > Select from two tables


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap