Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Sql Quickie!!

  • 20-10-2006 05:06PM
    #1
    Registered Users, Registered Users 2 Posts: 648 ✭✭✭


    hi

    i have 2 tables events and budget
    i need to select the events in teh past that do not have a budget entry

    below returns all events in the past ... i just dont know how to join them so as they only return the ones that DONT have a budget entry.

    anyone know?

    many thanks



    SELECT g.gigcal_gigs_id , g.gigtitle, g.gigdate FROM #__gigcal_gigs as g LEFT JOIN #__budget as b ON (b.event=g.gigcal_gigs_id) WHERE g.gigdate < '$now' ORDER BY g.gigdate


Comments

  • Registered Users, Registered Users 2 Posts: 45,085 ✭✭✭✭Basq


    Possibly..
    SELECT g.gigcal_gigs_id , g.gigtitle, g.gigdate FROM #__gigcal_gigs as g LEFT JOIN #__budget as b ON (b.event=g.gigcal_gigs_id) WHERE g.gigdate < '$now' and g.gigdate is not null ORDER BY g.gigdate


Advertisement