Modified sql syntax