SQL Basics

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



Go Back   Tutorialized ForumsDatabasesSQL Basics

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 Tutorialized Forums Sponsor:
  #1  
Old March 30th, 2017, 02:44 AM
klieha klieha is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2017
Location: Norway
Posts: 1 klieha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 6 m 56 sec
Reputation Power: 0
Exclude equal value

Hi. I just started my SQL training this week, so some noobines to be expected

I got a task to list up a projects motors and it's spaceheaters, in two coloums. Now, the name of the motor and spaceheater are in one table, and motor and space heater have their own. So I made a code with 3 joins and got the task completed.

Then next challenge was to exclude all hits where the motors and the spaceheater name was the same, just show the hits where the names are not the same.

I have tried WHERE NOT statments here and there, but it fails or come with the same result. Here is my code, hope someone can help me on the way

SELECT pi1.itemtag, pi2.itemtag, h1.heaterratedpower
FROM ekolel.t_plantitem pi1
JOIN ekolel.t_motor m1
on pi1.SP_ID = m1.SP_ID
JOIN ekolel.t_heater h1
on m1.sp_heaterid = h1.SP_ID
JOIN ekolel.t_plantitem pi2
on pi2.SP_ID = h1.SP_ID

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesSQL Basics > Exclude equal value


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