New to SQL. Could you show me a SQL query?

Discussion in 'Databases' started by pictureboarduk, May 3, 2008.

  1. #1
    Hi,

    i'm starting to learn Oracle SQL and the book I have wants me to write a query that selects conditions using logical OR. It must also use a calculated field.

    If you can give an example of one, I'll help you out in some way in return

    Thanks.
     
    pictureboarduk, May 3, 2008 IP
  2. podda999

    podda999 Greenhorn

    Messages:
    56
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    podda999, Nov 9, 2009 IP
  3. Toopac

    Toopac Peon

    Messages:
    4,451
    Likes Received:
    166
    Best Answers:
    0
    Trophy Points:
    0
    #3
     $query ="SELECT * FROM cars where id = $id";
     $result = mysql_query($query,$db) or die("GTFO my server noob");
     $myrow = mysql_fetch_array($result);
    Code (markup):
     
    Toopac, Nov 23, 2009 IP
  4. harishsyndrome

    harishsyndrome Peon

    Messages:
    128
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    read:

    Select * from <table name>

    Write

    Insert into <table_names> values (<values..>)
     
    harishsyndrome, Dec 2, 2009 IP
  5. sippsin

    sippsin Active Member

    Messages:
    237
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    63
    #5
    Join the Online Oracle Developer Community: "OraclePassport"

    Good Tutorials and FAQs for beginners and Professionals.

    OraclePassport Website, Forums and Wiki contains lot of information like:

    Oracle Tutorials
    Oracle Discussions
    Oracle Wiki
    Oracle Forums
    Oracle Interview Tips
    Oracle Objects
    Oracle Features
    Data Loaders


    Sippsin,
    Senior Oracle Developer | Technical Writer
    Oracle Tutorials, FAQ and Discussions Board
     
    sippsin, Dec 30, 2009 IP
  6. hemant.yadav

    hemant.yadav Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Select * From testtable where ID=1 OR ID=10 OR Name='YourName'
     
    hemant.yadav, Dec 31, 2009 IP
  7. QuackWare

    QuackWare Member

    Messages:
    245
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #7
    Check out these sql code samples and I am sure you will be able to find all the samples you could ever need.
     
    QuackWare, Jan 1, 2010 IP
  8. bertasoft

    bertasoft Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    SELECT * FROM Contacts WHERE Name='Bob' AND State='TX'
     
    bertasoft, Jan 10, 2010 IP
  9. braknar

    braknar Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    This doesn't really answer your request, but I recommend sqlzoo dot net (sorry minimum post requirement bs) in addition to your course. They have some nice exercises to help you get a bit of extra practice.
     
    braknar, Jan 16, 2010 IP
  10. WebWorth

    WebWorth Greenhorn

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    20
    #10
    Defiantly this site is excellent the exercises are completely interactive
     
    WebWorth, Jan 17, 2010 IP